diff options
Diffstat (limited to 'writerfilter/source/ooxml/OOXMLStreamImpl.cxx')
-rw-r--r-- | writerfilter/source/ooxml/OOXMLStreamImpl.cxx | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx index 16d7ae31100b..fe26b58cbe93 100644 --- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx @@ -173,6 +173,7 @@ bool OOXMLStreamImpl::lcl_getTarget(const uno::Reference<embed::XRelationshipAcc static const char sHeaderTypeStrict[] = "http://purl.oclc.org/ooxml/officeDocument/relationships/header"; static const char sOleObjectTypeStrict[] = "http://purl.oclc.org/ooxml/officeDocument/relationships/oleObject"; static const char sVBAProjectType[] = "http://schemas.microsoft.com/office/2006/relationships/vbaProject"; + static const char sVBADataType[] = "http://schemas.microsoft.com/office/2006/relationships/wordVbaData"; OUString sStreamType; OUString sStreamTypeStrict; @@ -183,6 +184,10 @@ bool OOXMLStreamImpl::lcl_getTarget(const uno::Reference<embed::XRelationshipAcc sStreamType = sVBAProjectType; sStreamTypeStrict = sVBAProjectType; break; + case VBADATA: + sStreamType = sVBADataType; + sStreamTypeStrict = sVBADataType; + break; case DOCUMENT: sStreamType = sDocumentType; sStreamTypeStrict = sDocumentTypeStrict; @@ -420,8 +425,22 @@ OOXMLDocumentFactory::createStream (const OOXMLStream::Pointer_t& pStream, OOXMLStream::StreamType_t nStreamType) { OOXMLStream::Pointer_t pRet; - if (OOXMLStreamImpl* pImpl = dynamic_cast<OOXMLStreamImpl *>(pStream.get())) - pRet.reset(new OOXMLStreamImpl(*pImpl, nStreamType)); + + if (nStreamType != OOXMLStream::VBADATA) + { + if (OOXMLStreamImpl* pImpl = dynamic_cast<OOXMLStreamImpl *>(pStream.get())) + pRet.reset(new OOXMLStreamImpl(*pImpl, nStreamType)); + } + else + { + // VBADATA is not a relation of the document, but of the VBAPROJECT stream. + if (OOXMLStreamImpl* pImpl = dynamic_cast<OOXMLStreamImpl *>(pStream.get())) + { + std::unique_ptr<OOXMLStreamImpl> pProject(new OOXMLStreamImpl(*pImpl, OOXMLStream::VBAPROJECT)); + pRet.reset(new OOXMLStreamImpl(*pProject, OOXMLStream::VBADATA)); + } + } + return pRet; } |