summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-02-04 09:31:11 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-02-09 17:08:37 +0100
commit7a55bce5effb2ca89a0a386182a1dbabfac0c889 (patch)
tree1d42798062c87b58f4290e00d913d7245f7d3f3b /sw/qa
parent0a50ed4fb20cc816a8999798339857862ec245b4 (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 fdfdc07c8979..a1b5d5e599b8 100644
--- a/sw/qa/extras/rtfexport/rtfexport4.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport4.cxx
@@ -295,6 +295,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: */