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>
This commit is contained in:
Rosemary Sebastian
2017-01-04 09:43:27 +05:30
committed by Markus Mohrhard
parent ebcad1fa79
commit 0fa23d9b49
6 changed files with 27 additions and 17 deletions

View File

@@ -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 )

View File

@@ -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 ),

View File

@@ -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(),

View File

@@ -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);

View File

@@ -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

View File

@@ -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