diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-02-21 16:40:57 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-03-01 12:21:03 +0100 |
commit | 7c04bc04476acc6ccaec7c7a2e6cb569215cd20f (patch) | |
tree | d3a234d0857267b5808dd8d05c084c8954cfcb87 | |
parent | 059172306a4c4f8fc800a539d9fb1266301822ad (diff) |
implement import of RTF_DOB{X,Y}{MARGIN,PAGE}
(cherry picked from commit fa9e867a342a37d84f02f7e801962761cc1d2b6f)
Signed-off-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 27 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 1 |
2 files changed, 26 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index a5f35787e273..413a82f2b0e2 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1967,8 +1967,31 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) case RTF_POSXR: m_aStates.top().aFrame.nHoriAlign = NS_ooxml::LN_Value_wordprocessingml_ST_XAlign_right; break; case RTF_DPLINE: - m_aStates.top().aDrawingObject.xShape.set(getModelFactory()->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.LineShape"))), uno::UNO_QUERY); - m_aStates.top().aDrawingObject.xPropertySet.set(m_aStates.top().aDrawingObject.xShape, uno::UNO_QUERY); + { + m_aStates.top().aDrawingObject.xShape.set(getModelFactory()->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.LineShape"))), uno::UNO_QUERY); + m_aStates.top().aDrawingObject.xPropertySet.set(m_aStates.top().aDrawingObject.xShape, uno::UNO_QUERY); + std::vector<beans::PropertyValue>& rPendingProperties = m_aStates.top().aDrawingObject.aPendingProperties; + for (std::vector<beans::PropertyValue>::iterator i = rPendingProperties.begin(); i != rPendingProperties.end(); ++i) + m_aStates.top().aDrawingObject.xPropertySet->setPropertyValue(i->Name, i->Value); + } + break; + case RTF_DOBXMARGIN: + case RTF_DOBYMARGIN: + { + beans::PropertyValue aPropertyValue; + aPropertyValue.Name = OUString(RTL_CONSTASCII_USTRINGPARAM((nKeyword == RTF_DOBXMARGIN ? "HoriOrientRelation" : "VertOrientRelation"))); + aPropertyValue.Value <<= text::RelOrientation::PAGE_PRINT_AREA; + m_aStates.top().aDrawingObject.aPendingProperties.push_back(aPropertyValue); + } + break; + case RTF_DOBXPAGE: + case RTF_DOBYPAGE: + { + beans::PropertyValue aPropertyValue; + aPropertyValue.Name = OUString(RTL_CONSTASCII_USTRINGPARAM((nKeyword == RTF_DOBXPAGE ? "HoriOrientRelation" : "VertOrientRelation"))); + aPropertyValue.Value <<= text::RelOrientation::PAGE_FRAME; + m_aStates.top().aDrawingObject.aPendingProperties.push_back(aPropertyValue); + } break; default: #if OSL_DEBUG_LEVEL > 1 diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 98fa57c9733f..0e92eb453cdf 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -187,6 +187,7 @@ namespace writerfilter { public: uno::Reference<drawing::XShape> xShape; uno::Reference<beans::XPropertySet> xPropertySet; + std::vector<beans::PropertyValue> aPendingProperties; }; /// Stores the properties of a picture. |