From 6e1758e5d852820b626d99b2208157ce7caeaca2 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Tue, 8 Jun 2021 12:54:05 +0200 Subject: chart2: use registerOOXMLNamespaces and registerODFNamespaces Change-Id: I2ee15ec29fbf5fc4fcaea035a9cd99ba49453a4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116831 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- chart2/qa/extras/chart2export.cxx | 24 +----------------------- chart2/qa/extras/chart2geometry.cxx | 32 ++------------------------------ 2 files changed, 3 insertions(+), 53 deletions(-) (limited to 'chart2/qa') 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(aNamespaces[i].pPrefix), - reinterpret_cast(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(aNamespaces[i].pPrefix), - reinterpret_cast(aNamespaces[i].pURI)); - } + XmlTestTools::registerOOXMLNamespaces(pXmlXPathCtx); + XmlTestTools::registerODFNamespaces(pXmlXPathCtx); } static OString OU2O(std::u16string_view sOUSource) -- cgit