diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-15 13:44:36 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-15 18:31:27 +0100 |
commit | 92dae379f9e9da3a515216a95a820032e895eafe (patch) | |
tree | fd196ae7c4728a3b059927e91af046be24ac923c /sw | |
parent | f858994c989091e3d4d5f9ea9169802583be2fe9 (diff) |
RTF filter: handle mirrored margins
Change-Id: I122f5f23e510ae42664d2b69504f4722aa05597e
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfexport/data/margmirror.rtf | 9 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 3 |
3 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/margmirror.rtf b/sw/qa/extras/rtfexport/data/margmirror.rtf new file mode 100644 index 000000000000..819cf5e8d42e --- /dev/null +++ b/sw/qa/extras/rtfexport/data/margmirror.rtf @@ -0,0 +1,9 @@ +{\rtf1 +\paperw11906\paperh16838\margl1800\margr4200\margt1440\margb1440 +\margmirror +foo +\par +\pagebb +bar +\par +} diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 438cb2d42ede..f056208d1513 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -15,6 +15,7 @@ #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/drawing/PointSequenceSequence.hpp> #include <com/sun/star/frame/XStorable.hpp> +#include <com/sun/star/style/PageStyleLayout.hpp> #include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/table/ShadowFormat.hpp> #include <com/sun/star/text/FontEmphasis.hpp> @@ -859,6 +860,13 @@ DECLARE_RTFEXPORT_TEST(testTdf88583, "tdf88583.odt") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x00cc00), getProperty<sal_Int32>(getParagraph(1), "FillColor")); } +DECLARE_RTFEXPORT_TEST(testMargmirror, "margmirror.rtf") +{ + // \margmirror was not handled, this was PageStyleLayout_ALL. + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(style::PageStyleLayout_MIRRORED, getProperty<style::PageStyleLayout>(xPageStyle, "PageStyleLayout")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 068e59d416ef..a8b991bcfd67 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -512,6 +512,9 @@ void RtfExport::ExportDocument_Impl() // Record changes? if (nsRedlineMode_t::REDLINE_ON & mnRedlineMode) Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_REVISIONS); + // Mirror margins? + if ((nsUseOnPage::PD_MIRROR & pDoc->GetPageDesc(0).ReadUseOn()) == nsUseOnPage::PD_MIRROR) + Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_MARGMIRROR); // Init sections m_pSections = new MSWordSections(*this); |