summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-03-28 21:27:40 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-03-29 09:59:28 +0100
commit89e5b431d468745da3a1eff14d48296107b9101b (patch)
tree7c93a3a8dd99c8be45f38b8ffdea846355b591a6 /sw/qa
parent92ce72a4731ad468f5928efd9da7fe66bfdb08ea (diff)
sw btlr writing mode: implement DOC filter
Replace WW8TabDesc::Start/EndMiserableHackForUnsupportedDirection() added in commit 69ba46df8be261e665214390cd57a141ad65c210 (INTEGRATION: CWS vertcell (1.95.32); FILE MERGED, 2004-04-21) with the usage of the new writing direction. Adapt export accordingly. Change-Id: Ic85b69c806fbd1c1b4eb21cff3ee46dd5da497e8 Reviewed-on: https://gerrit.libreoffice.org/69901 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ww8export/data/btlr-cell.docbin0 -> 26624 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx20
2 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/btlr-cell.doc b/sw/qa/extras/ww8export/data/btlr-cell.doc
new file mode 100644
index 000000000000..f99e9e67e4e9
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/btlr-cell.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index 955093393ed3..ba99e05deb36 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -16,6 +16,7 @@
#include <com/sun/star/text/XTextFramesSupplier.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/text/XTextTablesSupplier.hpp>
+#include <com/sun/star/text/WritingMode2.hpp>
#include <drawdoc.hxx>
#include <svx/xfillit0.hxx>
@@ -203,6 +204,25 @@ DECLARE_WW8EXPORT_TEST(testTdf120711_joinedParagraphWithChangeTracking, "tdf1207
CPPUNIT_ASSERT(style::NumberingType::CHAR_SPECIAL != numFormat);
}
+DECLARE_WW8EXPORT_TEST(testBtlrCell, "btlr-cell.doc")
+{
+ // Without the accompanying fix in place, this test would have failed, as
+ // the btlr text direction in the A1 cell was lost on DOC import and
+ // export.
+ uno::Reference<text::XTextTablesSupplier> xSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xTables = xSupplier->getTextTables();
+ uno::Reference<text::XTextTable> xTable(xTables->getByName("Table1"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xA1(xTable->getCellByName("A1"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(text::WritingMode2::BT_LR, getProperty<sal_Int16>(xA1, "WritingMode"));
+
+ uno::Reference<beans::XPropertySet> xB1(xTable->getCellByName("B1"), uno::UNO_QUERY);
+ auto nActual = getProperty<sal_Int16>(xB1, "WritingMode");
+ CPPUNIT_ASSERT(nActual == text::WritingMode2::LR_TB || nActual == text::WritingMode2::CONTEXT);
+
+ uno::Reference<beans::XPropertySet> xC1(xTable->getCellByName("C1"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(text::WritingMode2::TB_RL, getProperty<sal_Int16>(xC1, "WritingMode"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */