diff options
author | sushil_shinde <sushil.shinde@synerzip.com> | 2013-11-01 19:21:01 +0530 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-05 09:07:07 -0600 |
commit | 8ab553117e038ec1eab76ac1c3d8a0b5aa968baa (patch) | |
tree | 1945d427ef1d7789029b6a37c131d05e136854c2 /writerfilter/source/ooxml/OOXMLStreamImpl.cxx | |
parent | 0794e9ec93be4cfa11daefdb2e428952ea7669a5 (diff) |
[docx] CustomXml saved in InteropGrabBag and exported customxml when saving.
The XDocuments representing the DOM of an OOXML's customxml document is
stored as the PropertyValue "OOXCustomXml" into the "InteropGraBag".
Added mxCustomXmlDomList object which holds xDocuments for
each item.xml from CustomXml.
Exporting all items dom tree from customxml that has been parsed
when loading the file.
This is necessary in order to properly reopen docx files that
contain data like citation.
This fix grab bags only item[n].xml's files from CustomXml folder.
itemProps[n].xml's and item.xml's .rels are not preserved and exported yet.
(Working on this part)
Change-Id: I330f34f38a7aa4cd39094371bff15ebbc0318167
Reviewed-on: https://gerrit.libreoffice.org/6519
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerfilter/source/ooxml/OOXMLStreamImpl.cxx')
-rw-r--r-- | writerfilter/source/ooxml/OOXMLStreamImpl.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx index 96f37bdfbacd..293b69528da6 100644 --- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx @@ -110,6 +110,7 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess> static OUString sEndnotesType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes"); static OUString sCommentsType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"); static OUString sThemeType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"); + static OUString sCustomType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml"); static OUString sSettingsType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"); static OUString sTarget("Target"); static OUString sTargetMode("TargetMode"); @@ -147,6 +148,9 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess> case THEME: sStreamType = sThemeType; break; + case CUSTOMXML: + sStreamType = sCustomType; + break; case SETTINGS: sStreamType = sSettingsType; break; @@ -175,8 +179,15 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess> else if (aPair.First.compareTo(sId) == 0 && aPair.Second.compareTo(rId) == 0) bFound = true; - else if (aPair.First.compareTo(sTarget) == 0) - sMyTarget = aPair.Second; + else if (aPair.First.compareTo(sTarget) == 0){ + // checking item[n].xml is not visited already. + if(customTarget != aPair.Second && sStreamType == sCustomType){ + bFound = false; + } + else { + sMyTarget = aPair.Second; + } + } else if (aPair.First.compareTo(sTargetMode) == 0 && aPair.Second.compareTo(sExternal) == 0) bExternalTarget = true; @@ -260,6 +271,11 @@ uno::Reference<io::XInputStream> OOXMLStreamImpl::getDocumentStream() return xResult; } +// Giving access to mxDocumentStream. It is needed by resolving custom xml to get list of customxml's used in document. +uno::Reference<io::XStream> OOXMLStreamImpl::accessDocumentStream(){ + return mxDocumentStream; +} + uno::Reference<io::XInputStream> OOXMLStreamImpl::getStorageStream() { return mxStorageStream; |