summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-06-07 20:50:34 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-06-07 22:57:57 +0200
commit2b7bfe009ac35cb5fda9ca14404fea924acb54fa (patch)
treebffd34f916f20f610a9b8b912029a989a34ff35b /sc
parent039180f8255b6356cb89b1777e4e53323541898d (diff)
sd: use registerOOXMLNamespaces and registerODFNamespaces
While at it, fix incorrect r:Relationships with rels:Relationships Change-Id: Ia8e6556b0e7d3839e00936626627471a7a276071 Change-Id: I77f950dabd4d2131256673e517625d31ade9aa76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116800 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx8
-rw-r--r--sc/qa/unit/subsequent_export-test2.cxx48
2 files changed, 32 insertions, 24 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index bb22dbfefe36..ae2784a832e7 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -500,7 +500,7 @@ void ScExportTest::testTdf111876()
xmlDocUniquePtr pDoc = XPathHelper::parseExport2(*this, *xDocSh, m_xSFactory, "xl/worksheets/_rels/sheet1.xml.rels", FORMAT_XLSX);
CPPUNIT_ASSERT(pDoc);
- OUString sTarget = getXPath(pDoc, "/r:Relationships/r:Relationship", "Target");
+ OUString sTarget = getXPath(pDoc, "/rels:Relationships/rels:Relationship", "Target");
// Document is saved to the temporary directory, relative path should be different than original one
CPPUNIT_ASSERT(sTarget != "../xls/bug-fixes.xls");
@@ -3328,8 +3328,8 @@ void ScExportTest::testCustomXml()
CPPUNIT_ASSERT(pRelsDoc);
// Check there is a relation to itemProps1.xml.
- assertXPath(pRelsDoc, "/r:Relationships/r:Relationship", 1);
- assertXPath(pRelsDoc, "/r:Relationships/r:Relationship[@Id='rId1']", "Target", "itemProps1.xml");
+ assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship", 1);
+ assertXPath(pRelsDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target", "itemProps1.xml");
std::unique_ptr<SvStream> pStream = XPathHelper::parseExportStream(pXPathFile, m_xSFactory, "ddp/ddpfile.xen");
CPPUNIT_ASSERT(pStream);
@@ -3935,7 +3935,7 @@ void ScExportTest::testHyperlinkXLSX()
xmlDocUniquePtr pDoc = XPathHelper::parseExport2(*this, *xDocSh, m_xSFactory, "xl/drawings/_rels/drawing1.xml.rels", FORMAT_XLSX);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/r:Relationships/r:Relationship", "Target", "#Sheet2!A1");
+ assertXPath(pDoc, "/rels:Relationships/rels:Relationship", "Target", "#Sheet2!A1");
xDocSh->DoClose();
}
diff --git a/sc/qa/unit/subsequent_export-test2.cxx b/sc/qa/unit/subsequent_export-test2.cxx
index a47b9a413996..310d88a60f33 100644
--- a/sc/qa/unit/subsequent_export-test2.cxx
+++ b/sc/qa/unit/subsequent_export-test2.cxx
@@ -1198,9 +1198,11 @@ void ScExportTest2::testTdf115192XLSX()
xmlDocUniquePtr pDoc = XPathHelper::parseExport2(
*this, *xDocSh, m_xSFactory, "xl/drawings/_rels/drawing1.xml.rels", FORMAT_XLSX);
CPPUNIT_ASSERT(pDoc);
- assertXPath(pDoc, "/r:Relationships/r:Relationship[@Id='rId1']", "TargetMode", "External");
- assertXPathNoAttribute(pDoc, "/r:Relationships/r:Relationship[@Id='rId2']", "TargetMode");
- assertXPath(pDoc, "/r:Relationships/r:Relationship[@Id='rId3']", "TargetMode", "External");
+ assertXPath(pDoc, "/rels:Relationships/rels:Relationship[@Id='rId1']", "TargetMode",
+ "External");
+ assertXPathNoAttribute(pDoc, "/rels:Relationships/rels:Relationship[@Id='rId2']", "TargetMode");
+ assertXPath(pDoc, "/rels:Relationships/rels:Relationship[@Id='rId3']", "TargetMode",
+ "External");
xDocSh->DoClose();
}
@@ -1220,9 +1222,10 @@ void ScExportTest2::testTdf91634XLSX()
xmlDocUniquePtr pXmlRels
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/_rels/drawing1.xml.rels");
CPPUNIT_ASSERT(pXmlRels);
- assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId1']", "Target",
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target",
"https://www.google.com/");
- assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId1']", "TargetMode", "External");
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId1']", "TargetMode",
+ "External");
xDocSh->DoClose();
}
@@ -1367,13 +1370,17 @@ void ScExportTest2::testTdf123645XLSX()
xmlDocUniquePtr pXmlRels
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/_rels/drawing1.xml.rels");
CPPUNIT_ASSERT(pXmlRels);
- assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId1']", "TargetMode", "External");
- assertXPathNoAttribute(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId3']", "TargetMode");
- assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId5']", "TargetMode", "External");
- assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId1']", "Target",
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId1']", "TargetMode",
+ "External");
+ assertXPathNoAttribute(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId3']",
+ "TargetMode");
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId5']", "TargetMode",
+ "External");
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target",
"file:///C:/TEMP/test.xlsx");
- assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId3']", "Target", "#Sheet2!A1");
- assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId5']", "Target",
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId3']", "Target",
+ "#Sheet2!A1");
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId5']", "Target",
"https://bugs.documentfoundation.org/show_bug.cgi?id=123645");
xDocSh->DoClose();
@@ -1394,9 +1401,10 @@ void ScExportTest2::testTdf125173XLSX()
xmlDocUniquePtr pXmlRels
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/drawings/_rels/drawing1.xml.rels");
CPPUNIT_ASSERT(pXmlRels);
- assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId1']", "Target",
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId1']", "Target",
"http://www.google.com/");
- assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId1']", "TargetMode", "External");
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship[@Id='rId1']", "TargetMode",
+ "External");
xDocSh->DoClose();
}
@@ -1416,9 +1424,9 @@ void ScExportTest2::testTdf79972XLSX()
xmlDocUniquePtr pXmlRels
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/_rels/sheet1.xml.rels");
CPPUNIT_ASSERT(pXmlRels);
- assertXPath(pXmlRels, "/r:Relationships/r:Relationship", "Target",
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship", "Target",
"https://bugs.documentfoundation.org/show_bug.cgi?id=79972");
- assertXPath(pXmlRels, "/r:Relationships/r:Relationship", "TargetMode", "External");
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship", "TargetMode", "External");
xDocSh->DoClose();
}
@@ -1438,9 +1446,9 @@ void ScExportTest2::testTdf126024XLSX()
xmlDocUniquePtr pXmlRels
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/_rels/sheet1.xml.rels");
CPPUNIT_ASSERT(pXmlRels);
- assertXPath(pXmlRels, "/r:Relationships/r:Relationship", "Target",
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship", "Target",
"https://bugs.documentfoundation.org/");
- assertXPath(pXmlRels, "/r:Relationships/r:Relationship", "TargetMode", "External");
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship", "TargetMode", "External");
xDocSh->DoClose();
}
@@ -1460,9 +1468,9 @@ void ScExportTest2::testTdf126177XLSX()
xmlDocUniquePtr pXmlRels
= XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/_rels/sheet1.xml.rels");
CPPUNIT_ASSERT(pXmlRels);
- OUString aTarget = getXPath(pXmlRels, "/r:Relationships/r:Relationship", "Target");
+ OUString aTarget = getXPath(pXmlRels, "/rels:Relationships/rels:Relationship", "Target");
CPPUNIT_ASSERT(aTarget.endsWith("test.xlsx"));
- assertXPath(pXmlRels, "/r:Relationships/r:Relationship", "TargetMode", "External");
+ assertXPath(pXmlRels, "/rels:Relationships/rels:Relationship", "TargetMode", "External");
xDocSh->DoClose();
}
@@ -2120,7 +2128,7 @@ void ScExportTest2::testTdf138824_linkToParentDirectory()
CPPUNIT_ASSERT(pDoc);
// test also the Linux specific bug tdf#121472
- assertXPath(pDoc, "/r:Relationships/r:Relationship", "Target",
+ assertXPath(pDoc, "/rels:Relationships/rels:Relationship", "Target",
"../tdf138824_externalSource.ods");
xDocSh->DoClose();