summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorRosemary Sebastian <rosemary.seb8@gmail.com>2017-01-04 09:43:27 +0530
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-01-04 17:23:29 +0000
commit0fa23d9b499411407c1a0fed41e91f24d59d2ac0 (patch)
treefd1a66ed7019bd8c0ffac7fa7a7d27b26f9ddc78 /oox
parentebcad1fa79bf5e55bafebae38e59efd8bb445c13 (diff)
replace namespace URL strings with function calls...
Change-Id: I0b8b265df487aaeb76238013bc93c78e49a9e1a6 Reviewed-on: https://gerrit.libreoffice.org/32723 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/xmlfilterbase.cxx18
-rw-r--r--oox/source/export/chartexport.cxx13
-rw-r--r--oox/source/export/drawingml.cxx3
-rw-r--r--oox/source/export/shapes.cxx6
-rw-r--r--oox/source/token/namespaces-strict.txt2
-rw-r--r--oox/source/token/namespaces.txt2
6 files changed, 27 insertions, 17 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 85cfc9f67828..569110c4dd6a 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -597,11 +597,11 @@ writeCoreProperties( XmlFilterBase& rSelf, const Reference< XDocumentProperties
"docProps/core.xml",
"application/vnd.openxmlformats-package.core-properties+xml" );
pCoreProps->startElementNS( XML_cp, XML_coreProperties,
- FSNS( XML_xmlns, XML_cp ), "http://schemas.openxmlformats.org/package/2006/metadata/core-properties",
- FSNS( XML_xmlns, XML_dc ), "http://purl.org/dc/elements/1.1/",
- FSNS( XML_xmlns, XML_dcterms ), "http://purl.org/dc/terms/",
- FSNS( XML_xmlns, XML_dcmitype ), "http://purl.org/dc/dcmitype/",
- FSNS( XML_xmlns, XML_xsi ), "http://www.w3.org/2001/XMLSchema-instance",
+ FSNS( XML_xmlns, XML_cp ), OUStringToOString(rSelf.getNamespaceURL(OOX_NS(packageMetaCorePr)), RTL_TEXTENCODING_UTF8).getStr(),
+ FSNS( XML_xmlns, XML_dc ), OUStringToOString(rSelf.getNamespaceURL(OOX_NS(dc)), RTL_TEXTENCODING_UTF8).getStr(),
+ FSNS( XML_xmlns, XML_dcterms ), OUStringToOString(rSelf.getNamespaceURL(OOX_NS(dcTerms)), RTL_TEXTENCODING_UTF8).getStr(),
+ FSNS( XML_xmlns, XML_dcmitype ), OUStringToOString(rSelf.getNamespaceURL(OOX_NS(dcmiType)), RTL_TEXTENCODING_UTF8).getStr(),
+ FSNS( XML_xmlns, XML_xsi ), OUStringToOString(rSelf.getNamespaceURL(OOX_NS(xsi)), RTL_TEXTENCODING_UTF8).getStr(),
FSEND );
#ifdef OOXTODO
@@ -640,8 +640,8 @@ writeAppProperties( XmlFilterBase& rSelf, const Reference< XDocumentProperties >
"docProps/app.xml",
"application/vnd.openxmlformats-officedocument.extended-properties+xml" );
pAppProps->startElement( XML_Properties,
- XML_xmlns, "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",
- FSNS( XML_xmlns, XML_vt ), "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",
+ XML_xmlns, OUStringToOString(rSelf.getNamespaceURL(OOX_NS(officeExtPr)), RTL_TEXTENCODING_UTF8).getStr(),
+ FSNS( XML_xmlns, XML_vt ), OUStringToOString(rSelf.getNamespaceURL(OOX_NS(officeDocPropsVT)), RTL_TEXTENCODING_UTF8).getStr(),
FSEND );
writeElement( pAppProps, XML_Template, xProperties->getTemplateName() );
@@ -742,8 +742,8 @@ writeCustomProperties( XmlFilterBase& rSelf, const Reference< XDocumentPropertie
"docProps/custom.xml",
"application/vnd.openxmlformats-officedocument.custom-properties+xml" );
pAppProps->startElement( XML_Properties,
- XML_xmlns, "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",
- FSNS( XML_xmlns, XML_vt ), "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",
+ XML_xmlns, OUStringToOString(rSelf.getNamespaceURL(OOX_NS(officeCustomPr)), RTL_TEXTENCODING_UTF8).getStr(),
+ FSNS( XML_xmlns, XML_vt ), OUStringToOString(rSelf.getNamespaceURL(OOX_NS(officeDocPropsVT)), RTL_TEXTENCODING_UTF8).getStr(),
FSEND );
for ( sal_Int32 n = 0; n < nbCustomProperties; ++n )
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 79d0699c0e54..1bdd6835ffa4 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <oox/token/namespaces.hxx>
#include <oox/token/tokens.hxx>
#include "oox/core/xmlfilterbase.hxx"
#include "oox/export/chartexport.hxx"
@@ -594,9 +595,10 @@ void ChartExport::WriteChartObj( const Reference< XShape >& xShape, sal_Int32 nC
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",
&sId );
+ XmlFilterBase* pFB = GetFB();
pFS->singleElement( FSNS( XML_c, XML_chart ),
- FSNS( XML_xmlns, XML_c ), "http://schemas.openxmlformats.org/drawingml/2006/chart",
- FSNS( XML_xmlns, XML_r ), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
+ FSNS( XML_xmlns, XML_c ), OUStringToOString(pFB->getNamespaceURL(OOX_NS(dmlChart)), RTL_TEXTENCODING_UTF8).getStr(),
+ FSNS( XML_xmlns, XML_r ), OUStringToOString(pFB->getNamespaceURL(OOX_NS(officeRel)), RTL_TEXTENCODING_UTF8).getStr(),
FSNS( XML_r, XML_id ), USS( sId ),
FSEND );
@@ -732,10 +734,11 @@ void ChartExport::exportChartSpace( const Reference< css::chart::XChartDocument
bool bIncludeTable )
{
FSHelperPtr pFS = GetFS();
+ XmlFilterBase* pFB = GetFB();
pFS->startElement( FSNS( XML_c, XML_chartSpace ),
- FSNS( XML_xmlns, XML_c ), "http://schemas.openxmlformats.org/drawingml/2006/chart",
- FSNS( XML_xmlns, XML_a ), "http://schemas.openxmlformats.org/drawingml/2006/main",
- FSNS( XML_xmlns, XML_r ), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
+ FSNS( XML_xmlns, XML_c ), OUStringToOString(pFB->getNamespaceURL(OOX_NS(dmlChart)), RTL_TEXTENCODING_UTF8).getStr(),
+ FSNS( XML_xmlns, XML_a ), OUStringToOString(pFB->getNamespaceURL(OOX_NS(dml)), RTL_TEXTENCODING_UTF8).getStr(),
+ FSNS( XML_xmlns, XML_r ), OUStringToOString(pFB->getNamespaceURL(OOX_NS(officeRel)), RTL_TEXTENCODING_UTF8).getStr(),
FSEND );
// TODO: get the correct editing language
pFS->singleElement( FSNS( XML_c, XML_lang ),
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 7de9e39c52e1..8befbca17584 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -24,6 +24,7 @@
#include "oox/export/utils.hxx"
#include <oox/drawingml/color.hxx>
#include <oox/drawingml/fillproperties.hxx>
+#include <oox/token/namespaces.hxx>
#include <oox/token/tokens.hxx>
#include <oox/drawingml/drawingmltypes.hxx>
@@ -3350,7 +3351,7 @@ void DrawingML::WriteArtisticEffect( const Reference< XPropertySet >& rXPropSet
XML_uri, "{BEBA8EAE-BF5A-486C-A8C5-ECC9F3942E4B}",
FSEND );
mpFS->startElementNS( XML_a14, XML_imgProps,
- FSNS( XML_xmlns, XML_a14 ), "http://schemas.microsoft.com/office/drawing/2010/main",
+ FSNS( XML_xmlns, XML_a14 ), OUStringToOString(mpFB->getNamespaceURL(OOX_NS(a14)), RTL_TEXTENCODING_UTF8).getStr(),
FSEND );
mpFS->startElementNS( XML_a14, XML_imgLayer,
FSNS( XML_r, XML_embed), sRelId.getStr(),
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index c28efd840878..abb57d48b807 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -25,6 +25,7 @@
#include "oox/core/xmlfilterbase.hxx"
#include "oox/export/shapes.hxx"
#include "oox/export/utils.hxx"
+#include <oox/token/namespaces.hxx>
#include <oox/token/tokens.hxx>
#include <cstdio>
@@ -1079,12 +1080,13 @@ void ShapeExport::WriteGraphicObjectShapePart( const Reference< XShape >& xShape
}
FSHelperPtr pFS = GetFS();
+ XmlFilterBase* pFB = GetFB();
if (GetDocumentType() != DOCUMENT_DOCX)
pFS->startElementNS( mnXmlNamespace, XML_pic, FSEND );
else
pFS->startElementNS( mnXmlNamespace, XML_pic,
- FSNS(XML_xmlns, XML_pic), "http://schemas.openxmlformats.org/drawingml/2006/picture",
+ FSNS(XML_xmlns, XML_pic), OUStringToOString(pFB->getNamespaceURL(OOX_NS(dmlPicture)), RTL_TEXTENCODING_UTF8).getStr(),
FSEND );
pFS->startElementNS( mnXmlNamespace, XML_nvPicPr, FSEND );
@@ -1813,7 +1815,7 @@ void ShapeExport::WriteMathShape(Reference<XShape> const& xShape)
// WordProcessingML so write a MCE like PPT 2010 does
mpFS->startElementNS(XML_mc, XML_AlternateContent, FSEND);
mpFS->startElementNS(XML_mc, XML_Choice,
- FSNS(XML_xmlns, XML_a14), "http://schemas.microsoft.com/office/drawing/2010/main",
+ FSNS(XML_xmlns, XML_a14), OUStringToOString(mpFB->getNamespaceURL(OOX_NS(a14)), RTL_TEXTENCODING_UTF8).getStr(),
XML_Requires, "a14",
FSEND);
mpFS->startElementNS(mnXmlNamespace, XML_sp, FSEND);
diff --git a/oox/source/token/namespaces-strict.txt b/oox/source/token/namespaces-strict.txt
index 0f606f775213..d6990e5bdf91 100644
--- a/oox/source/token/namespaces-strict.txt
+++ b/oox/source/token/namespaces-strict.txt
@@ -20,6 +20,7 @@
xml http://www.w3.org/XML/1998/namespace
schema http://purl.oclc.org/ooxml/schemaLibrary/main
+xsi http://www.w3.org/2001/XMLSchema-instance
# package ---------------------------------------------------------------------
@@ -67,6 +68,7 @@ vmlWord urn:schemas-microsoft-com:office:word
ax http://schemas.microsoft.com/office/2006/activeX
dc http://purl.org/dc/elements/1.1/
dcTerms http://purl.org/dc/terms/
+dcmiType http://purl.org/dc/dcmitype/
xm http://schemas.microsoft.com/office/excel/2006/main
mce http://schemas.openxmlformats.org/markup-compatibility/2006
mceTest http://schemas.openxmlformats.org/spreadsheetml/2006/main/v2
diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt
index 4b6f49a56ef8..604541129469 100644
--- a/oox/source/token/namespaces.txt
+++ b/oox/source/token/namespaces.txt
@@ -20,6 +20,7 @@
xml http://www.w3.org/XML/1998/namespace
schema http://schemas.openxmlformats.org/schemaLibrary/2006/main
+xsi http://www.w3.org/2001/XMLSchema-instance
# package ---------------------------------------------------------------------
@@ -67,6 +68,7 @@ vmlWord urn:schemas-microsoft-com:office:word
ax http://schemas.microsoft.com/office/2006/activeX
dc http://purl.org/dc/elements/1.1/
dcTerms http://purl.org/dc/terms/
+dcmiType http://purl.org/dc/dcmitype/
xm http://schemas.microsoft.com/office/excel/2006/main
mce http://schemas.openxmlformats.org/markup-compatibility/2006
mceTest http://schemas.openxmlformats.org/spreadsheetml/2006/main/v2