Kaydet (Commit) 92dae379 authored tarafından Miklos Vajna's avatar Miklos Vajna

RTF filter: handle mirrored margins

Change-Id: I122f5f23e510ae42664d2b69504f4722aa05597e
üst f858994c
{\rtf1
\paperw11906\paperh16838\margl1800\margr4200\margt1440\margb1440
\margmirror
foo
\par
\pagebb
bar
\par
}
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/PointSequenceSequence.hpp> #include <com/sun/star/drawing/PointSequenceSequence.hpp>
#include <com/sun/star/frame/XStorable.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/BorderLine2.hpp>
#include <com/sun/star/table/ShadowFormat.hpp> #include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/text/FontEmphasis.hpp> #include <com/sun/star/text/FontEmphasis.hpp>
...@@ -859,6 +860,13 @@ DECLARE_RTFEXPORT_TEST(testTdf88583, "tdf88583.odt") ...@@ -859,6 +860,13 @@ DECLARE_RTFEXPORT_TEST(testTdf88583, "tdf88583.odt")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x00cc00), getProperty<sal_Int32>(getParagraph(1), "FillColor")); 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(); CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -512,6 +512,9 @@ void RtfExport::ExportDocument_Impl() ...@@ -512,6 +512,9 @@ void RtfExport::ExportDocument_Impl()
// Record changes? // Record changes?
if (nsRedlineMode_t::REDLINE_ON & mnRedlineMode) if (nsRedlineMode_t::REDLINE_ON & mnRedlineMode)
Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_REVISIONS); 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 // Init sections
m_pSections = new MSWordSections(*this); m_pSections = new MSWordSections(*this);
......
...@@ -3491,6 +3491,9 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) ...@@ -3491,6 +3491,9 @@ RTFError RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
case RTF_NOCOLBAL: case RTF_NOCOLBAL:
m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Compat_noColumnBalance, std::make_shared<RTFValue>(1)); m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Compat_noColumnBalance, std::make_shared<RTFValue>(1));
break; break;
case RTF_MARGMIRROR:
m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_mirrorMargins, std::make_shared<RTFValue>(1));
break;
default: default:
{ {
SAL_INFO("writerfilter", "TODO handle flag '" << lcl_RtfToString(nKeyword) << "'"); SAL_INFO("writerfilter", "TODO handle flag '" << lcl_RtfToString(nKeyword) << "'");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment