summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorRosemary Sebastian <rosemary.seb8@gmail.com>2017-01-03 18:31:43 +0530
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-01-03 17:11:11 +0000
commitf1dcb8b3e2e01848d44dd1beb82cd4e6e68a2acd (patch)
treef1d1b80abfc2fa6df4f587fdf2fd132ed4a6779c /sc
parent4c53e17d47bea97168bd07630ccf781639dd03d1 (diff)
replace hard-coded namespace URL strings with function calls...
Follow-up for https://gerrit.libreoffice.org/#/c/32425/; Change-Id: I59f77f0ccd681fb96bb9f1e7ec4b38d41c4f331a Reviewed-on: https://gerrit.libreoffice.org/32695 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/excdoc.cxx9
-rw-r--r--sc/source/filter/excel/xecontent.cxx2
-rw-r--r--sc/source/filter/excel/xedbdata.cxx3
-rw-r--r--sc/source/filter/excel/xeescher.cxx13
-rw-r--r--sc/source/filter/excel/xeextlst.cxx8
-rw-r--r--sc/source/filter/excel/xelink.cxx5
-rw-r--r--sc/source/filter/excel/xepivotxml.cxx11
-rw-r--r--sc/source/filter/excel/xestyle.cxx3
8 files changed, 31 insertions, 23 deletions
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index a1a2a75443d4..cd1a46678181 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -76,6 +76,7 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <oox/token/tokens.hxx>
+#include <oox/token/namespaces.hxx>
#include <memory>
using namespace oox;
@@ -734,8 +735,8 @@ void ExcTable::WriteXml( XclExpXmlStream& rStrm )
rStrm.PushStream( pWorksheet );
pWorksheet->startElement( XML_worksheet,
- XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
- FSNS( XML_xmlns, XML_r ), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
+ XML_xmlns, XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
+ FSNS( XML_xmlns, XML_r ), XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(officeRel))).getStr(),
FSEND );
SetCurrScTab( mnScTab );
@@ -855,8 +856,8 @@ void ExcDocument::WriteXml( XclExpXmlStream& rStrm )
sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream();
rWorkbook->startElement( XML_workbook,
- XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
- FSNS(XML_xmlns, XML_r), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
+ XML_xmlns, XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
+ FSNS(XML_xmlns, XML_r), XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(officeRel))).getStr(),
FSEND );
rWorkbook->singleElement( XML_fileVersion,
XML_appName, "Calc",
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index b74eeb1d2a15..dae805f4222c 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -204,7 +204,7 @@ void XclExpSstImpl::SaveXml( XclExpXmlStream& rStrm )
rStrm.PushStream( pSst );
pSst->startElement( XML_sst,
- XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
+ XML_xmlns, XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
XML_count, OString::number( mnTotal ).getStr(),
XML_uniqueCount, OString::number( mnSize ).getStr(),
FSEND );
diff --git a/sc/source/filter/excel/xedbdata.cxx b/sc/source/filter/excel/xedbdata.cxx
index 4c8e3974fc05..7c9d48ae537d 100644
--- a/sc/source/filter/excel/xedbdata.cxx
+++ b/sc/source/filter/excel/xedbdata.cxx
@@ -13,6 +13,7 @@
#include "dbdata.hxx"
#include "document.hxx"
#include <oox/export/utils.hxx>
+#include <oox/token/namespaces.hxx>
using namespace oox;
@@ -180,7 +181,7 @@ void XclExpTables::SaveTableXml( XclExpXmlStream& rStrm, const Entry& rEntry )
rData.GetArea( aRange);
sax_fastparser::FSHelperPtr& pTableStrm = rStrm.GetCurrentStream();
pTableStrm->startElement( XML_table,
- XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
+ XML_xmlns, XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls14Lst))).getStr(),
XML_id, OString::number( rEntry.mnTableId).getStr(),
XML_name, XclXmlUtils::ToOString( rData.GetName()).getStr(),
XML_displayName, XclXmlUtils::ToOString( rData.GetName()).getStr(),
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 35fe29f2139f..c783ea33ba4e 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -74,6 +74,7 @@
#include <oox/export/drawingml.hxx>
#include <oox/export/chartexport.hxx>
#include <oox/export/utils.hxx>
+#include <oox/token/namespaces.hxx>
#include <memory>
using namespace com::sun::star;
@@ -1422,16 +1423,16 @@ void XclExpComments::SaveXml( XclExpXmlStream& rStrm )
if( rStrm.getVersion() == oox::core::ISOIEC_29500_2008 )
rComments->startElement( XML_comments,
- XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
- FSNS( XML_xmlns, XML_mc ), "http://schemas.openxmlformats.org/markup-compatibility/2006",
- FSNS( XML_xmlns, XML_xdr ), "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
- FSNS( XML_xmlns, XML_v2 ), "http://schemas.openxmlformats.org/spreadsheetml/2006/main/v2",
+ XML_xmlns, XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
+ FSNS( XML_xmlns, XML_mc ), XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(mce))).getStr(),
+ FSNS( XML_xmlns, XML_xdr ), XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(dmlSpreadDr))).getStr(),
+ FSNS( XML_xmlns, XML_v2 ), XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(mceTest))).getStr(),
FSNS( XML_mc, XML_Ignorable ), "v2",
FSEND );
else
rComments->startElement( XML_comments,
- XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
- FSNS( XML_xmlns, XML_xdr ), "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
+ XML_xmlns, XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
+ FSNS( XML_xmlns, XML_xdr ), XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(dmlSpreadDr))).getStr(),
FSEND );
rComments->startElement( XML_authors, FSEND );
diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx
index c1b1252e8901..fd6d5a10e572 100644
--- a/sc/source/filter/excel/xeextlst.cxx
+++ b/sc/source/filter/excel/xeextlst.cxx
@@ -15,6 +15,8 @@
#include "xecontent.hxx"
#include "tokenarray.hxx"
+#include <oox/token/namespaces.hxx>
+
using namespace ::oox;
namespace {
@@ -350,7 +352,7 @@ void XclExpExtConditionalFormatting::SaveXml( XclExpXmlStream& rStrm )
{
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
rWorksheet->startElementNS( XML_x14, XML_conditionalFormatting,
- FSNS( XML_xmlns, XML_xm ), "http://schemas.microsoft.com/office/excel/2006/main",
+ FSNS( XML_xmlns, XML_xm ), XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xm))).getStr(),
FSEND );
maCfRules.SaveXml( rStrm );
@@ -396,7 +398,7 @@ void XclExpExtCalcPr::SaveXml( XclExpXmlStream& rStrm )
{
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
rWorksheet->startElement( XML_ext,
- FSNS( XML_xmlns, XML_loext ), "http://schemas.libreoffice.org/",
+ FSNS( XML_xmlns, XML_loext ), XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(loext))).getStr(),
XML_uri, maURI.getStr(),
FSEND );
@@ -417,7 +419,7 @@ void XclExpExtCondFormat::SaveXml( XclExpXmlStream& rStrm )
{
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
rWorksheet->startElement( XML_ext,
- FSNS( XML_xmlns, XML_x14 ), "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main",
+ FSNS( XML_xmlns, XML_x14 ), XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls14Lst))).getStr(),
XML_uri, maURI.getStr(),
FSEND );
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx
index dd8025a56d30..d26cc5db850e 100644
--- a/sc/source/filter/excel/xelink.cxx
+++ b/sc/source/filter/excel/xelink.cxx
@@ -21,6 +21,7 @@
#include <algorithm>
#include <formula/errorcodes.hxx>
+#include <oox/token/namespaces.hxx>
#include <unotools/collatorwrapper.hxx>
#include <svl/zforlist.hxx>
#include "document.hxx"
@@ -1677,11 +1678,11 @@ void XclExpSupbook::SaveXml( XclExpXmlStream& rStrm )
true );
pExternalLink->startElement( XML_externalLink,
- XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
+ XML_xmlns, XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
FSEND);
pExternalLink->startElement( XML_externalBook,
- FSNS(XML_xmlns, XML_r), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
+ FSNS(XML_xmlns, XML_r), XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(officeRel))).getStr(),
FSNS(XML_r, XML_id), XclXmlUtils::ToOString( sId ).getStr(),
FSEND);
diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx
index 1b340812cc3f..c38b818200ff 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -15,6 +15,7 @@
#include <document.hxx>
#include <oox/export/utils.hxx>
+#include <oox/token/namespaces.hxx>
#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
#include <com/sun/star/sheet/DataPilotOutputRangeType.hpp>
@@ -36,8 +37,8 @@ void savePivotCacheRecordsXml( XclExpXmlStream& rStrm, const ScDPCache& rCache )
sax_fastparser::FSHelperPtr& pRecStrm = rStrm.GetCurrentStream();
pRecStrm->startElement(XML_pivotCacheRecords,
- XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
- FSNS(XML_xmlns, XML_r), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
+ XML_xmlns, XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
+ FSNS(XML_xmlns, XML_r), XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(officeRel))).getStr(),
XML_count, OString::number(static_cast<long>(nCount)).getStr(),
FSEND);
@@ -192,8 +193,8 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( XclExpXmlStream& rStrm, const Entr
rStrm.PopStream();
pDefStrm->startElement(XML_pivotCacheDefinition,
- XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
- FSNS(XML_xmlns, XML_r), "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
+ XML_xmlns, XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
+ FSNS(XML_xmlns, XML_r), XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(officeRel))).getStr(),
FSNS(XML_r, XML_id), XclXmlUtils::ToOString(aRelId).getStr(),
XML_recordCount, OString::number(rEntry.mpCache->GetDataSize()).getStr(),
FSEND);
@@ -497,7 +498,7 @@ void XclExpXmlPivotTables::SavePivotTableXml( XclExpXmlStream& rStrm, const ScDP
sax_fastparser::FSHelperPtr& pPivotStrm = rStrm.GetCurrentStream();
pPivotStrm->startElement(XML_pivotTableDefinition,
- XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
+ XML_xmlns, XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
XML_name, XclXmlUtils::ToOString(rDPObj.GetName()).getStr(),
XML_cacheId, OString::number(nCacheId).getStr(),
XML_applyNumberFormats, BS(false),
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index f5944d581626..f13aa29b07f5 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -51,6 +51,7 @@
#include "conditio.hxx"
#include <oox/token/tokens.hxx>
+#include <oox/token/namespaces.hxx>
#include <o3tl/make_unique.hxx>
using namespace ::com::sun::star;
@@ -3137,7 +3138,7 @@ void XclExpXmlStyleSheet::SaveXml( XclExpXmlStream& rStrm )
rStrm.PushStream( aStyleSheet );
aStyleSheet->startElement( XML_styleSheet,
- XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
+ XML_xmlns, XclXmlUtils::ToOString(rStrm.getNamespaceURL(OOX_NS(xls))).getStr(),
FSEND );
CreateRecord( EXC_ID_FORMATLIST )->SaveXml( rStrm );