summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-08-28 21:28:34 -0400
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-06 09:07:39 +0200
commit176a723876b0138debb20f824103b2ab0c910401 (patch)
tree72181577b6f8fc78d3d431e7412b557225f0e0a6 /sw/qa
parentc210019f36ec4a640fe1967b562454a21c371d63 (diff)
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 <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ww8export/data/tdf112074_RTLtableJustification.docbin0 -> 24576 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export2.cxx16
2 files changed, 16 insertions, 0 deletions
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
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf112074_RTLtableJustification.doc
Binary files 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 <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/text/HoriOrientation.hpp>
+#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/text/XTextFramesSupplier.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/text/XTextTablesSupplier.hpp>
@@ -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<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("Right To Left writing mode", text::WritingMode2::RL_TB, getProperty<sal_Int16>(xTable, "WritingMode"));
+ if ( !mbExported )
+ {
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Horizontal Orientation", text::HoriOrientation::LEFT_AND_WIDTH, getProperty<sal_Int16>(xTable, "HoriOrient"));
+ CPPUNIT_ASSERT_MESSAGE("Table Indent", getProperty<long>(xTable, "LeftMargin") > 3000);
+ }
+}
+
DECLARE_WW8EXPORT_TEST(testTdf104805, "tdf104805.doc")
{
uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WW8Num1"), uno::UNO_QUERY);