summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlexport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-09-19 13:52:37 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-09-19 14:54:38 +0200
commite85d8f9c5aadee9872ec6d7f33567f9ed84b478d (patch)
tree29719883b88b09052e5fc24fac1add6ebaaeed34 /sw/qa/extras/ooxmlexport
parent879bfcbf84fc7b73b5475d3f02e98184a2065dc5 (diff)
fdo#83728 DOCX import: fix table alignment
Regression from 614b31615e69b527e669635245cf59faf9c9e2fc (Use NS_ooxml::LN_Value_ST_Jc_{right,end} constants, 2014-09-05), one more remnant from doctok. Change-Id: Ibab68eada337a3fe1bc919987a09a8b146f86ac9
Diffstat (limited to 'sw/qa/extras/ooxmlexport')
-rw-r--r--sw/qa/extras/ooxmlexport/data/table-alignment.docxbin0 -> 13187 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx10
2 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/table-alignment.docx b/sw/qa/extras/ooxmlexport/data/table-alignment.docx
new file mode 100644
index 000000000000..e1efaaefd56b
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/table-alignment.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 15e0eaedbf52..953a036249ea 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -11,6 +11,7 @@
#include <com/sun/star/awt/XBitmap.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/XTextRangeCompare.hpp>
#include <string>
@@ -232,6 +233,15 @@ DECLARE_OOXMLEXPORT_TEST(testDropdownInCell, "dropdown-in-cell.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextRangeCompare->compareRegionStarts(xAnchor, xCell));
}
+DECLARE_OOXMLEXPORT_TEST(testTableAlignment, "table-alignment.docx")
+{
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ // This was LEFT_AND_WIDTH, i.e. table alignment wasn't imported correctly.
+ CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::RIGHT, getProperty<sal_Int16>(xTable, "HoriOrient"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */