summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-02-28 10:39:56 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-03-11 05:40:05 -0500
commit585bd120327508ad68816c8005cb36e1d3116351 (patch)
tree10438e144c77af86939d68deb0c7140c71e4ec77 /writerfilter
parent0ceeab004f3e448322bf5a0119f779443bb42b91 (diff)
handle OOXML strict namespaces
Change-Id: I198862388426161e3f054a5f128639c59f3c9d24 support OOXML strict documents in Calc Conflicts: oox/source/core/relations.cxx Change-Id: I277d76aeec28e173d913ccc1506464afe4d09c6d import date cells from OOXML Change-Id: Id0b9ec034d559d489ca4ee2d1d6aca1bdf1beb9d no need to add another layer of macros Change-Id: I49992559a7d10127d55dbf0c7e257c86619fd8d6 fix one more relation type for OOXML strict Change-Id: Ia63309271ac225883540ca0453fc5da21844d3ad make more places aware of OOXML strict relations Change-Id: I292217537eb592cbad9af11f87402baa9f4cc442 fix strict namespace list generation The two perl scripts were apparently only generating the same order by luck. It did not work on all systems. Change-Id: Ib83ee5c6572d3bae2e2ac1846850bd65303e7d43 allow OOXML strict relationships in writer Conflicts: writerfilter/source/ooxml/OOXMLDocumentImpl.cxx writerfilter/source/ooxml/OOXMLStreamImpl.cxx Change-Id: I1c09280f68467748faedee19c4a66be3bc7d7aa3 make sure the two namespace lists are sorted the same way Change-Id: I90b3182e10dbbfc8993010dd885509537d2fe537 fix OOXML strict chart import Change-Id: I84a2fd575ced64d4774147063f13ebb8605c100f add the xml strict namespaces to misc/namespaces.txt Change-Id: Ie83b5c94f1f002851bff3b39b1d9b676a3e44aa1 Reviewed-on: https://gerrit.libreoffice.org/8515 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/ooxml/OOXMLDocumentImpl.cxx12
-rw-r--r--writerfilter/source/ooxml/OOXMLStreamImpl.cxx32
2 files changed, 39 insertions, 5 deletions
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index f272375b682a..fdc0531545ab 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -475,7 +475,8 @@ void OOXMLDocumentImpl::resolveCustomXmlStream(Stream & rStream)
mxRelationshipAccess.set((*dynamic_cast<OOXMLStreamImpl *>(mpStream.get())).accessDocumentStream(), uno::UNO_QUERY_THROW);
if (mxRelationshipAccess.is())
{
- OUString sCustomType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml");
+ static const OUString sCustomType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml");
+ static const OUString sCustomTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/customXml");
OUString sTarget("Target");
bool bFound = false;
sal_Int32 counter = 0;
@@ -491,7 +492,8 @@ void OOXMLDocumentImpl::resolveCustomXmlStream(Stream & rStream)
beans::StringPair aPair = aSeq[i];
// Need to resolve only customxml files from document relationships.
// Skipping other files.
- if (aPair.Second.compareTo(sCustomType) == 0)
+ if (aPair.Second.compareTo(sCustomType) == 0 ||
+ aPair.Second.compareTo(sCustomTypeStrict) == 0)
bFound = true;
else if(aPair.First.compareTo(sTarget) == 0 && bFound)
{
@@ -530,7 +532,8 @@ void OOXMLDocumentImpl::resolveActiveXStream(Stream & rStream)
mxRelationshipAccess.set((*dynamic_cast<OOXMLStreamImpl *>(mpStream.get())).accessDocumentStream(), uno::UNO_QUERY_THROW);
if (mxRelationshipAccess.is())
{
- OUString sCustomType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/control");
+ static const OUString sCustomType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/control");
+ static const OUString sCustomTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/control");
OUString sTarget("Target");
bool bFound = false;
sal_Int32 counter = 0;
@@ -546,7 +549,8 @@ void OOXMLDocumentImpl::resolveActiveXStream(Stream & rStream)
beans::StringPair aPair = aSeq[i];
// Need to resolve only ActiveX files from document relationships.
// Skipping other files.
- if (aPair.Second.compareTo(sCustomType) == 0)
+ if (aPair.Second.compareTo(sCustomType) == 0 ||
+ aPair.Second.compareTo(sCustomTypeStrict) == 0)
bFound = true;
else if(aPair.First.compareTo(sTarget) == 0 && bFound)
{
diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
index dd6875426b33..90a90727114c 100644
--- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
@@ -115,56 +115,85 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess>
static OUString sActiveXType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/control");
static OUString sActiveXBinType("http://schemas.microsoft.com/office/2006/relationships/activeXControlBinary");
static OUString sSettingsType("http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings");
+ // OOXML strict
+ static OUString sDocumentTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument");
+ static OUString sStylesTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/styles");
+ static OUString sNumberingTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/numbering");
+ static OUString sFonttableTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/fontTable");
+ static OUString sFootnotesTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/footnotes");
+ static OUString sEndnotesTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/endnotes");
+ static OUString sCommentsTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/comments");
+ static OUString sThemeTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/theme");
+ static OUString sCustomTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/customXml");
+ static OUString sCustomPropsTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/customXmlProps");
+ static OUString sActiveXTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/control");
+ static OUString sGlossaryTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/glossaryDocument");
+ static OUString sSettingsTypeStrict("http://purl.oclc.org/ooxml/officeDocument/relationships/settings");
static OUString sTarget("Target");
static OUString sTargetMode("TargetMode");
static OUString sExternal("External");
static OUString sVBAProjectType("http://schemas.microsoft.com/office/2006/relationships/vbaProject");
OUString sStreamType;
+ OUString sStreamTypeStrict;
switch (nStreamType)
{
case VBAPROJECT:
sStreamType = sVBAProjectType;
+ sStreamTypeStrict = sVBAProjectType;
break;
case DOCUMENT:
sStreamType = sDocumentType;
+ sStreamTypeStrict = sDocumentTypeStrict;
break;
case STYLES:
sStreamType = sStylesType;
+ sStreamTypeStrict = sStylesTypeStrict;
break;
case NUMBERING:
sStreamType = sNumberingType;
+ sStreamTypeStrict = sNumberingTypeStrict;
break;
case FONTTABLE:
sStreamType = sFonttableType;
+ sStreamTypeStrict = sFonttableTypeStrict;
break;
case FOOTNOTES:
sStreamType = sFootnotesType;
+ sStreamTypeStrict = sFootnotesTypeStrict;
break;
case ENDNOTES:
sStreamType = sEndnotesType;
+ sStreamTypeStrict = sEndnotesTypeStrict;
break;
case COMMENTS:
sStreamType = sCommentsType;
+ sStreamTypeStrict = sCommentsTypeStrict;
break;
case THEME:
sStreamType = sThemeType;
+ sStreamTypeStrict = sThemeTypeStrict;
break;
case CUSTOMXML:
sStreamType = sCustomType;
+ sStreamTypeStrict = sCustomTypeStrict;
break;
case CUSTOMXMLPROPS:
sStreamType = sCustomPropsType;
+ sStreamTypeStrict = sCustomPropsTypeStrict;
break;
case ACTIVEX:
sStreamType = sActiveXType;
+ sStreamTypeStrict = sActiveXTypeStrict;
break;
case ACTIVEXBIN:
sStreamType = sActiveXBinType;
+ sStreamTypeStrict = sActiveXBinType;
break;
case SETTINGS:
sStreamType = sSettingsType;
+ sStreamTypeStrict = sSettingsTypeStrict;
break;
default:
break;
@@ -186,7 +215,8 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess>
beans::StringPair aPair = aSeq[i];
if (aPair.First.compareTo(sType) == 0 &&
- aPair.Second.compareTo(sStreamType) == 0)
+ ( aPair.Second.compareTo(sStreamType) == 0 ||
+ aPair.Second.compareTo(sStreamTypeStrict) == 0))
bFound = true;
else if (aPair.First.compareTo(sId) == 0 &&
aPair.Second.compareTo(rId) == 0)