diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-02-05 17:27:26 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-02-06 15:16:38 +0100 |
commit | faf0635def4ef603563f7288cb29d24e3f2ce1e3 (patch) | |
tree | 4a10ec120eefeacfe4ddfcb273da925f9b30d9ee /sw/qa | |
parent | e1d217b086e8c47efc5ced4c490062956d564e3f (diff) |
tdf#91920 sw page gutter margin, from top: add RTF export
The documentation for \gutterprl is "Parallel gutter.", but it seems
that's what Word use to convert between RTF and DOCX's <w:gutterAtTop/>.
Change-Id: I06d80f234c6f52950db8a047bfc88910b808977d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110484
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/rtfexport/data/gutter-top.rtf | 4 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport4.cxx | 14 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/gutter-top.rtf b/sw/qa/extras/rtfexport/data/gutter-top.rtf new file mode 100644 index 000000000000..9c9a78ce2d03 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/gutter-top.rtf @@ -0,0 +1,4 @@ +{\rtf1 +\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter720\gutterprl +\pard\plain Half inch gutter on the top\par +} diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx index 2bfdf0a13c87..669deb82f144 100644 --- a/sw/qa/extras/rtfexport/rtfexport4.cxx +++ b/sw/qa/extras/rtfexport/rtfexport4.cxx @@ -400,6 +400,20 @@ CPPUNIT_TEST_FIXTURE(Test, testGutterLeft) CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1270), nGutterMargin); } +CPPUNIT_TEST_FIXTURE(Test, testGutterTop) +{ + load(mpTestDocumentPath, "gutter-top.rtf"); + reload(mpFilter, "gutter-left.rtf"); + uno::Reference<lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xSettings( + xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY); + bool bGutterAtTop{}; + xSettings->getPropertyValue("GutterAtTop") >>= bGutterAtTop; + // Without the accompanying fix in place, this test would have failed, becase the gutter was + // at the left. + CPPUNIT_ASSERT(bGutterAtTop); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |