diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-02-21 16:40:57 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-02-21 17:28:40 +0100 |
commit | fa9e867a342a37d84f02f7e801962761cc1d2b6f (patch) | |
tree | baf109297a6c2a263e85f490c73e1ec848926dfd /writerfilter | |
parent | implement import of RTF_DPLINE (diff) | |
download | core-fa9e867a342a37d84f02f7e801962761cc1d2b6f.tar.gz core-fa9e867a342a37d84f02f7e801962761cc1d2b6f.zip |
implement import of RTF_DOB{X,Y}{MARGIN,PAGE}
Diffstat (limited to 'writerfilter')
-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 9bc8caf93697..806b43f6ca8f 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1985,8 +1985,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: SAL_INFO("writerfilter", OSL_THIS_FUNC << ": TODO handle flag '" << lcl_RtfToString(nKeyword) << "'"); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index d5cdedca0d34..a6c09951c828 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. |