sw/qa/extras/rtfexport/data/margmirror.rtf | 9 +++++++++ sw/qa/extras/rtfexport/rtfexport.cxx | 8 ++++++++ sw/source/core/doc/fmtcol.cxx | 8 ++++++++ sw/source/core/docnode/nodedump.cxx | 12 ------------ sw/source/filter/ww8/rtfexport.cxx | 3 +++ writerfilter/source/rtftok/rtfdocumentimpl.cxx | 3 +++ 6 files changed, 31 insertions(+), 12 deletions(-)
New commits: commit 92dae379f9e9da3a515216a95a820032e895eafe Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Sun Feb 15 13:44:36 2015 +0100 RTF filter: handle mirrored margins Change-Id: I122f5f23e510ae42664d2b69504f4722aa05597e diff --git a/sw/qa/extras/rtfexport/data/margmirror.rtf b/sw/qa/extras/rtfexport/data/margmirror.rtf new file mode 100644 index 0000000..819cf5e --- /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 438cb2d..f056208 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 068e59d..a8b991b 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); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 0b124a5..d6adeae 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -3491,6 +3491,9 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) case RTF_NOCOLBAL: m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Compat_noColumnBalance, std::make_shared<RTFValue>(1)); break; + case RTF_MARGMIRROR: + m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_mirrorMargins, std::make_shared<RTFValue>(1)); + break; default: { SAL_INFO("writerfilter", "TODO handle flag '" << lcl_RtfToString(nKeyword) << "'"); commit f858994c989091e3d4d5f9ea9169802583be2fe9 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Sun Feb 15 13:34:11 2015 +0100 Extract SwTxtFmtColls::dumpAsXml() from docnode Change-Id: Ie5d2865aeca0292044eaed72b8ea6c5e5316a3cb diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index 8f6af9c..5124ec4 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -472,6 +472,14 @@ void SwTxtFmtColl::dumpAsXml(xmlTextWriterPtr pWriter) const xmlTextWriterEndElement(pWriter); } +void SwTxtFmtColls::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("swTxtFmtColls")); + for (size_t i = 0; i < size(); ++i) + GetFmt(i)->dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); +} + //FEATURE::CONDCOLL SwCollCondition::SwCollCondition( SwTxtFmtColl* pColl, sal_uLong nMasterCond, diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index e2910b0..bd2438d 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -301,18 +301,6 @@ void SwSectionFmts::dumpAsXml(xmlTextWriterPtr w) const } } -void SwTxtFmtColls::dumpAsXml(xmlTextWriterPtr w) const -{ - WriterHelper writer(w); - if (size()) - { - writer.startElement("swtxtfmtcolls"); - for (size_t i = 0; i < size(); ++i) - GetFmt(i)->dumpAsXml(w); - writer.endElement(); - } -} - void SwTxtNode::dumpAsXml( xmlTextWriterPtr w ) const { WriterHelper writer( w ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits