diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-15 18:32:30 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-16 15:32:25 +0200 |
commit | 3617548b24db8966193acfe9d720232c4fe1d56c (patch) | |
tree | c9e3ac7e27a684a78ffc9972eac1a6811aaca7c9 | |
parent | 581314958f0ddd6c3a0536ce2d7e7e6f0c53a8ec (diff) |
RTF import: allow multiple children for ooxml:OLEObject_OLEObject
Change-Id: Iec84588daf5555d1207827efb0f26d8354ad462b
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 15 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 3 |
2 files changed, 10 insertions, 8 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 2e1fd4e88f3f..591945751cad 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -250,7 +250,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x m_aFormfieldSprms(), m_aFormfieldAttributes(), m_nFormFieldType(RTFFormFieldType::NONE), - m_aObjectSprms(), + m_aOLEAttributes(), m_aObjectAttributes(), m_bObject(false), m_aFontTableEntries(), @@ -5391,10 +5391,7 @@ RTFError RTFDocumentImpl::popState() uno::Reference<io::XInputStream> xInputStream(new utl::OInputStreamWrapper(m_pObjectData.get())); auto pStreamValue = std::make_shared<RTFValue>(xInputStream); - RTFSprms aOLEAttributes; - aOLEAttributes.set(NS_ooxml::LN_inputstream, pStreamValue); - auto pValue = std::make_shared<RTFValue>(aOLEAttributes); - m_aObjectSprms.set(NS_ooxml::LN_OLEObject_OLEObject, pValue); + m_aOLEAttributes.set(NS_ooxml::LN_inputstream, pStreamValue); } break; case Destination::OBJECT: @@ -5407,9 +5404,13 @@ RTFError RTFDocumentImpl::popState() break; } + RTFSprms aObjectSprms; + auto pOLEValue = std::make_shared<RTFValue>(m_aOLEAttributes); + aObjectSprms.set(NS_ooxml::LN_OLEObject_OLEObject, pOLEValue); + RTFSprms aObjAttributes; RTFSprms aObjSprms; - auto pValue = std::make_shared<RTFValue>(m_aObjectAttributes, m_aObjectSprms); + auto pValue = std::make_shared<RTFValue>(m_aObjectAttributes, aObjectSprms); aObjSprms.set(NS_ooxml::LN_object, pValue); writerfilter::Reference<Properties>::Pointer_t pProperties = std::make_shared<RTFReferenceProperties>(aObjAttributes, aObjSprms); uno::Reference<drawing::XShape> xShape; @@ -5421,7 +5422,7 @@ RTFError RTFDocumentImpl::popState() Mapper().props(pProperties); Mapper().endShape(); m_aObjectAttributes.clear(); - m_aObjectSprms.clear(); + m_aOLEAttributes.clear(); m_bObject = false; } break; diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index b4543b1989e3..7112c5833eb6 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -539,7 +539,8 @@ private: RTFSprms m_aFormfieldAttributes; RTFFormFieldType m_nFormFieldType; - RTFSprms m_aObjectSprms; + /// OLE attributes are attributes of the ooxml:OLEObject_OLEObject sprm. + RTFSprms m_aOLEAttributes; RTFSprms m_aObjectAttributes; /** If we are in an object group and if the we use its * \objdata element. |