From c802c5f390a30a66118f56a01e47772a54743a6a Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 25 Nov 2022 19:26:46 +0300 Subject: Require valid attribute in getXPath The reason for accepting empty attribute was eliminated in commit 2f91ab025de850fe5af8114565755a8deed55911 (Merge two assertXPath overloads that both check number of nodes, Nov 25 16:36:57 2022) Change-Id: I6cd77eb0f73650dfdafd55946b5269ffe3f0bde5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143304 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sw/qa/extras/ooxmlexport/ooxmlexport17.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sw') diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx index e294a51feabb..87e7d0c68b21 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx @@ -873,7 +873,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf81507, "tdf81507.docx") CPPUNIT_ASSERT_EQUAL(OUString("0"), getXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:sdt/w:sdtPr/w:text", "multiLine")); // Ensure that we have - getXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:sdt/w:sdtPr/w:text", ""); + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:sdt/w:sdtPr/w:text"); // Ensure that we have no (not quite correct case, but to ensure import/export are okay) xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, "/w:document/w:body/w:p[4]/w:sdt/w:sdtPr/w:text"); @@ -974,8 +974,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148455_2, "tdf148455_2.docx") xmlDocUniquePtr pNumberingDoc = parseExport("word/numbering.xml"); // Ensure we have empty lvlOverride for levels 0 - 1 - getXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='0']", ""); - getXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='1']", ""); + assertXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='0']"); + assertXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='1']"); // And normal override for level 2 getXPath(pNumberingDoc, "/w:numbering/w:num[@w:numId='" + OString::number(nListId) +"']/w:lvlOverride[@w:ilvl='2']/w:startOverride", "val"); } -- cgit