summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-11-15 15:19:11 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-11-15 16:00:52 +0100
commit08eaac43602964029beac4e05102267bcb05c407 (patch)
tree8c127ca8fc90f1e68a990716bf73a76f14b6163f /sw
parent4f8442440681eaaa8db1a800843d2ed25f111681 (diff)
RTF import: handle right-to-left tables
Change-Id: If2e60557b7551839c344d56cb3a720ae3659e93c
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfexport/data/table-rtl.rtf5
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx10
2 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/table-rtl.rtf b/sw/qa/extras/rtfexport/data/table-rtl.rtf
new file mode 100644
index 000000000000..bba72e0d31a9
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/table-rtl.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+\trowd\rtlrow\cellx4703\cellx9514
+\pard\plain\intbl A1\cell B1\cell\row
+\pard\plain\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index de2753705a58..593f01e0d236 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/text/XFootnotesSupplier.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <vcl/svapp.hxx>
@@ -826,6 +827,15 @@ DECLARE_RTFEXPORT_TEST(testCjklist38, "cjklist38.rtf")
CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_UPPER_ZH, numFormat);
}
+DECLARE_RTFEXPORT_TEST(testTableRtl, "table-rtl.rtf")
+{
+ 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 text::WritingMode2::LR_TB, i.e. direction of the table was ignored.
+ CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>(xTable, "WritingMode"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */