summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ww8export/ww8export2.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-03-27 08:32:05 +0300
committerJustin Luth <justin_luth@sil.org>2020-03-28 20:17:19 +0100
commitcd868678583fa92833c37a63089131ba905dd3a6 (patch)
tree0f7644f3823e99fb86bd47abb6fe8a64fe000611 /sw/qa/extras/ww8export/ww8export2.cxx
parentbefd6880873cc3f63a0566b76246d2ae54f8a3c5 (diff)
tdf#80635 ww8import:2 take float table RIGHT to inlined table
Since SW has problems with floating tables, any unnecessarily floated tables are converted to inline. However, the positioning of the tables is mostly lost. So the choice is either to refuse to inline a strangely positioned table or else to transfer the positioning onto the inlined table. Transferring is easier said than done. But for right-aligned tables, hopefully it is easy to copy that without causing trouble. I didn't find any real-world examples in existing unit tests or bug reports, so I made up my own complicated one using both right margin and BIDI. Change-Id: I855ae62531b5930cbc9a3272c3a7228dd7b0df53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91272 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw/qa/extras/ww8export/ww8export2.cxx')
-rw-r--r--sw/qa/extras/ww8export/ww8export2.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index b477b03bbeaa..4672b750baa3 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -252,6 +252,28 @@ DECLARE_WW8EXPORT_TEST(testTdf116570_exportFootnote, "tdf116570_exportFootnote.o
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of paragraphs in first footnote", 2, getParagraphs(xFootnoteText) );
}
+DECLARE_WW8EXPORT_TEST(testTdf80635_pageRightRTL, "tdf80635_pageRightRTL.doc")
+{
+ // tdf#80635 - transfer the float orientation to the table.
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Horizontal Orientation", text::HoriOrientation::LEFT_AND_WIDTH, getProperty<sal_Int16>(xTable, "HoriOrient"));
+ //CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table Indent", long(3500), getProperty<long>(xTable, "LeftMargin"), 100);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Did you fix me? Text probably should wrap here", 2, getPages() );
+ // If so, replace test with the table set to a greater preferred width so that the text shouldn't wrap
+}
+
+DECLARE_WW8EXPORT_TEST(testTdf80635_marginRTL, "tdf80635_marginRightRTL.doc")
+{
+ // tdf#80635 - transfer the float orientation to the table.
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ if ( !mbExported )
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Horizontal Orientation", text::HoriOrientation::RIGHT, getProperty<sal_Int16>(xTable, "HoriOrient"));
+}
+
DECLARE_WW8EXPORT_TEST(testTdf107773, "tdf107773.doc")
{
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);