summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-06-08 12:54:05 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-06-08 15:36:17 +0200
commit6e1758e5d852820b626d99b2208157ce7caeaca2 (patch)
tree650999cf8176a82631d4484cb8271d92e4847e64 /chart2
parent086fa727cabf46eacfec1a0fd4f6dfe916aa2f04 (diff)
chart2: use registerOOXMLNamespaces and registerODFNamespaces
Change-Id: I2ee15ec29fbf5fc4fcaea035a9cd99ba49453a4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116831 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2export.cxx24
-rw-r--r--chart2/qa/extras/chart2geometry.cxx32
2 files changed, 3 insertions, 53 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 817f3d1734a2..dabf7b4ed277 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -404,29 +404,7 @@ xmlDocUniquePtr Chart2ExportTest::parseExport(const OUString& rDir, const OUStri
void Chart2ExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
{
- static struct { char const * pPrefix; char const * pURI; } const aNamespaces[] =
- {
- { "w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main" },
- { "v", "urn:schemas-microsoft-com:vml" },
- { "c", "http://schemas.openxmlformats.org/drawingml/2006/chart" },
- { "a", "http://schemas.openxmlformats.org/drawingml/2006/main" },
- { "mc", "http://schemas.openxmlformats.org/markup-compatibility/2006" },
- { "wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape" },
- { "wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" },
- { "wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" },
- { "office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0" },
- { "table", "urn:oasis:names:tc:opendocument:xmlns:table:1.0" },
- { "text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0" },
- { "xlink", "http://www.w3c.org/1999/xlink" },
- { "c15", "http://schemas.microsoft.com/office/drawing/2012/chart" }
- };
- for(size_t i = 0; i < SAL_N_ELEMENTS(aNamespaces); ++i)
- {
- xmlXPathRegisterNs(
- pXmlXPathCtx,
- reinterpret_cast<xmlChar const *>(aNamespaces[i].pPrefix),
- reinterpret_cast<xmlChar const *>(aNamespaces[i].pURI));
- }
+ XmlTestTools::registerOOXMLNamespaces(pXmlXPathCtx);
}
namespace {
diff --git a/chart2/qa/extras/chart2geometry.cxx b/chart2/qa/extras/chart2geometry.cxx
index 4f57654a3587..d6c243ccfd76 100644
--- a/chart2/qa/extras/chart2geometry.cxx
+++ b/chart2/qa/extras/chart2geometry.cxx
@@ -139,36 +139,8 @@ xmlDocUniquePtr Chart2GeometryTest::parseExport(const OUString& rDir, const OUSt
void Chart2GeometryTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
{
- static struct
- {
- char const* pPrefix;
- char const* pURI;
- } const aNamespaces[] = {
- // OOXML
- { "w", "http://schemas.openxmlformats.org/wordprocessingml/2006/main" },
- { "v", "urn:schemas-microsoft-com:vml" },
- { "c", "http://schemas.openxmlformats.org/drawingml/2006/chart" },
- { "a", "http://schemas.openxmlformats.org/drawingml/2006/main" },
- { "mc", "http://schemas.openxmlformats.org/markup-compatibility/2006" },
- { "wps", "http://schemas.microsoft.com/office/word/2010/wordprocessingShape" },
- { "wpg", "http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" },
- { "wp", "http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" },
- { "c15", "http://schemas.microsoft.com/office/drawing/2012/chart" },
- // ODF
- { "office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0" },
- { "chart", "urn:oasis:names:tc:opendocument:xmlns:chart:1.0" },
- { "draw", "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" },
- { "style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0" },
- { "svg", "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" },
- { "table", "urn:oasis:names:tc:opendocument:xmlns:table:1.0" },
- { "text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0" },
- { "xlink", "http://www.w3c.org/1999/xlink" },
- };
- for (size_t i = 0; i < SAL_N_ELEMENTS(aNamespaces); ++i)
- {
- xmlXPathRegisterNs(pXmlXPathCtx, reinterpret_cast<xmlChar const*>(aNamespaces[i].pPrefix),
- reinterpret_cast<xmlChar const*>(aNamespaces[i].pURI));
- }
+ XmlTestTools::registerOOXMLNamespaces(pXmlXPathCtx);
+ XmlTestTools::registerODFNamespaces(pXmlXPathCtx);
}
static OString OU2O(std::u16string_view sOUSource)