summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-02-04 09:31:11 +0100
committerAndras Timar <andras.timar@collabora.com>2021-04-01 08:53:32 +0200
commitc7d19a3221b97b978f2c7cfec1c44520be70effc (patch)
treee26f99f6915e20c9d33cb1e57a5694165929d690 /sw/qa
parent44fc4514af88fda455c6106839144abb4815f0c4 (diff)
tdf#91920 sw page gutter margin: add RTF filter
Map between \gutter and SvxLRSpaceItem::m_nGutterMargin. (cherry picked from commit 113e7c1be4ca87f936738270cf763800e8ec5832) Change-Id: I40303f87f59d18e04beb016869dc2a8f3c7da755 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110637 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/rtfexport/data/gutter-left.rtf4
-rw-r--r--sw/qa/extras/rtfexport/rtfexport4.cxx15
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/gutter-left.rtf b/sw/qa/extras/rtfexport/data/gutter-left.rtf
new file mode 100644
index 000000000000..66016045c9d1
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/gutter-left.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter720
+\pard\plain Half in gutter on the left\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx
index 55eb4a2b8c48..56b5c33139b1 100644
--- a/sw/qa/extras/rtfexport/rtfexport4.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport4.cxx
@@ -385,6 +385,21 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf126309)
static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust")));
}
+CPPUNIT_TEST_FIXTURE(Test, testGutterLeft)
+{
+ load(mpTestDocumentPath, "gutter-left.rtf");
+ reload(mpFilter, "gutter-left.rtf");
+ uno::Reference<beans::XPropertySet> xPageStyle;
+ getStyles("PageStyles")->getByName("Standard") >>= xPageStyle;
+ sal_Int32 nGutterMargin{};
+ xPageStyle->getPropertyValue("GutterMargin") >>= nGutterMargin;
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 1270
+ // - Actual : 0
+ // i.e. gutter margin was lost.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), nGutterMargin);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */