summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-04-01 09:21:39 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-04-01 10:07:21 +0200
commitf15c6c5d2947a61e6521471b6b7541812953efc3 (patch)
tree14611c291253fbb920b1305d1ffb56866714f6f4 /sw/qa
parentc1c817de2780684e41ce5c5783ac895bcf06ab4c (diff)
tdf#140343 sw page rtl gutter margin: add RTF filter
Map to the \rtlgutter section flag. This means that now rtl gutter is handled for all Word formats. Change-Id: I4c2c12b7df2ce2109d4d638df71e6b7f322afe52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113439 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtfexport/data/rtl-gutter.rtf4
-rw-r--r--sw/qa/extras/rtfexport/rtfexport3.cxx17
2 files changed, 21 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/rtl-gutter.rtf b/sw/qa/extras/rtfexport/data/rtl-gutter.rtf
new file mode 100644
index 000000000000..45c7c86b4500
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/rtl-gutter.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\paperw8395\paperh5947\margl360\margr360\margt720\margb1440\gutter1080\rtlgutter
+\pard\plain hello\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx
index a3b5f6b2779c..6f801bc3f8cc 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -404,6 +404,23 @@ DECLARE_RTFEXPORT_TEST(testTdf128428_dntblnsbdb, "tdf128428_dntblnsbdb.rtf")
CPPUNIT_ASSERT_EQUAL(1, getPages());
}
+CPPUNIT_TEST_FIXTURE(Test, testRtlGutter)
+{
+ auto verify = [this]() {
+ uno::Reference<beans::XPropertySet> xStandard(
+ getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(getProperty<bool>(xStandard, "RtlGutter"));
+ };
+
+ // Given a document with RTL gutter, when loading it:
+ load(mpTestDocumentPath, "rtl-gutter.rtf");
+ // Then make sure the section's gutter is still RTL:
+ // Without the accompanying fix in place, this test would have failed as \rtlgutter was missing.
+ verify();
+ reload(mpFilter, "rtl-gutter.rtf");
+ verify();
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */