diff options
| author | Tuong Nguyen Manh <[email protected]> | 2025-12-29 01:13:06 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-28 17:13:06 -0700 |
| commit | 854b7332d9f3044be15344fd57637f15b482f7e9 (patch) | |
| tree | 6983b33c1e1e217b824e91eea08bf62045ff4bb3 /test | |
| parent | d21c17c096778f5892c070633d595627c9c530f2 (diff) | |
ODT reader: Add table row and column spans (#11366)
Parse the number-rows-spanned and number-columns-spanned attributes to
create Cells for the Table.
Diffstat (limited to 'test')
| -rw-r--r-- | test/Tests/Readers/ODT.hs | 1 | ||||
| -rw-r--r-- | test/odt/native/tableWithSpans.native | 134 | ||||
| -rw-r--r-- | test/odt/odt/tableWithSpans.odt | bin | 0 -> 10695 bytes |
3 files changed, 135 insertions, 0 deletions
diff --git a/test/Tests/Readers/ODT.hs b/test/Tests/Readers/ODT.hs index a5e2dc009..dcca9237d 100644 --- a/test/Tests/Readers/ODT.hs +++ b/test/Tests/Readers/ODT.hs @@ -186,6 +186,7 @@ namesOfTestsComparingToNative = [ "blockquote" -- , "table" , "textMixedStyles" , "tableWithContents" + , "tableWithSpans" , "unicode" , "unorderedList" , "unorderedListHeader" diff --git a/test/odt/native/tableWithSpans.native b/test/odt/native/tableWithSpans.native new file mode 100644 index 000000000..6faaebad9 --- /dev/null +++ b/test/odt/native/tableWithSpans.native @@ -0,0 +1,134 @@ +[ Table + ( "" , [] , [] ) + (Caption Nothing []) + [ ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + , ( AlignDefault , ColWidthDefault ) + ] + (TableHead + ( "" , [] , [] ) + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 2) + (ColSpan 1) + [ Plain + [ Str "H1" + , Space + , Str "Rowspan" + , Space + , Str "2" + ] + ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "H1-2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "H1-3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 2) + [ Plain [ Str "H2-2/3" ] ] + ] + ]) + [ TableBody + ( "" , [] , [] ) + (RowHeadColumns 0) + [] + [ Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "B1-1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "B1-2" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 3) + (ColSpan 1) + [ Plain [ Str "Rowspan" , Space , Str "3" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "B2-1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "B2-2" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 2) + [ Plain [ Str "Columnspan" , Space , Str "2" ] ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "B4-1" ] ] + , Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 2) + (ColSpan 2) + [ Plain + [ Str "Columnspan" + , Space + , Str "&" + , Space + , Str "Rowspan" + , Space + , Str "2" + ] + ] + ] + , Row + ( "" , [] , [] ) + [ Cell + ( "" , [] , [] ) + AlignDefault + (RowSpan 1) + (ColSpan 1) + [ Plain [ Str "B5-1" ] ] + ] + ] + ] + (TableFoot ( "" , [] , [] ) []) +, Para [] +] diff --git a/test/odt/odt/tableWithSpans.odt b/test/odt/odt/tableWithSpans.odt Binary files differnew file mode 100644 index 000000000..f37e0b6b5 --- /dev/null +++ b/test/odt/odt/tableWithSpans.odt |
