diff options
author | Justin Luth <justin.luth@collabora.com> | 2020-03-27 08:09:29 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-03-30 09:37:35 +0200 |
commit | ba989a99ea19ffd0aafeea01f9b737ea79fa952a (patch) | |
tree | 3860c07cdc4f28e97eb40d38c5b7c46c49e6e797 /sw/qa/extras/ww8export/ww8export2.cxx | |
parent | 79b578b7f8b5e3a80fcd0fd86e83d96d7c900bb1 (diff) |
tdf#80635 ww8import:3 take float table orient 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.
For absolutely positioned flies, which are LEFT_AND_WIDTH,
pass the X position to the left margin.
Change-Id: I996a06c753e8b9b1151f7deea8ad4caf5724dd0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91273
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa/extras/ww8export/ww8export2.cxx')
-rw-r--r-- | sw/qa/extras/ww8export/ww8export2.cxx | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index 4672b750baa3..42cc8237b873 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -259,7 +259,7 @@ DECLARE_WW8EXPORT_TEST(testTdf80635_pageRightRTL, "tdf80635_pageRightRTL.doc") 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_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 } @@ -274,6 +274,26 @@ DECLARE_WW8EXPORT_TEST(testTdf80635_marginRTL, "tdf80635_marginRightRTL.doc") CPPUNIT_ASSERT_EQUAL_MESSAGE("Horizontal Orientation", text::HoriOrientation::RIGHT, getProperty<sal_Int16>(xTable, "HoriOrient")); } +DECLARE_WW8EXPORT_TEST(testTdf80635_marginLeft, "tdf80635_marginLeft.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); + // This was just the GetMinLeft of -199 + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table Indent", long(-2950), getProperty<long>(xTable, "LeftMargin"), 100); +} + +DECLARE_WW8EXPORT_TEST(testTdf80635_pageLeft, "tdf80635_pageLeft.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); + // This was just the GetMinLeft of -199 + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table Indent", long(-2750), getProperty<long>(xTable, "LeftMargin"), 100); +} + DECLARE_WW8EXPORT_TEST(testTdf107773, "tdf107773.doc") { uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); |