From 176a723876b0138debb20f824103b2ab0c910401 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Mon, 28 Aug 2017 21:28:34 -0400 Subject: tdf#112074 doc import: use real width if no preferred width If the document did not specify a preferred table width, then the indent was completely wrong. I don't think the "else" clause ever provided a correct value. See https://bz.apache.org/ooo/attachment.cgi?id=63705&action=diff These documents don't round-trip at all, so making changes here ought to be fairly regression-safe since the documents are read-only anyway. Change-Id: I6308ffd22b6f7ce60b9780e00b68bc6f8b09a6fa Reviewed-on: https://gerrit.libreoffice.org/41664 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Miklos Vajna --- .../ww8export/data/tdf112074_RTLtableJustification.doc | Bin 0 -> 24576 bytes sw/qa/extras/ww8export/ww8export2.cxx | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 sw/qa/extras/ww8export/data/tdf112074_RTLtableJustification.doc (limited to 'sw/qa/extras') diff --git a/sw/qa/extras/ww8export/data/tdf112074_RTLtableJustification.doc b/sw/qa/extras/ww8export/data/tdf112074_RTLtableJustification.doc new file mode 100644 index 000000000000..64ea6521e814 Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf112074_RTLtableJustification.doc differ diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index f9e69f03cf90..0074969fbb13 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include #include #include @@ -194,6 +196,20 @@ DECLARE_WW8EXPORT_TEST(testTdf108448_endNote, "tdf108448_endNote.odt") CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of paragraphs in Endnote i", 1, nRet ); } +DECLARE_WW8EXPORT_TEST(testTdf112074_RTLtableJustification, "tdf112074_RTLtableJustification.doc") +{ + uno::Reference xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Right To Left writing mode", text::WritingMode2::RL_TB, getProperty(xTable, "WritingMode")); + if ( !mbExported ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE("Horizontal Orientation", text::HoriOrientation::LEFT_AND_WIDTH, getProperty(xTable, "HoriOrient")); + CPPUNIT_ASSERT_MESSAGE("Table Indent", getProperty(xTable, "LeftMargin") > 3000); + } +} + DECLARE_WW8EXPORT_TEST(testTdf104805, "tdf104805.doc") { uno::Reference xPropertySet(getStyles("NumberingStyles")->getByName("WW8Num1"), uno::UNO_QUERY); -- cgit