summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-11-25 15:20:48 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-11-25 16:54:30 +0100
commitec345c02d8fa5a7c7d4ea4ad08ae7be5303d9b20 (patch)
tree4dd95d5b760239bd06332dfd72bbda0bb652d664 /test
parent75eb99cec153e720407b44c376285a0c543018b2 (diff)
tdf#152200: Make sure to not write objects into field character runs
Similar how it's done for preceding objects immediately after calculating 'ofs', we also need to make sure to create a separate run for the objects that may be anchored after the last character; otherwise, the field that was just processed (and is waiting in the attributes) would be put out of place, inside an inner run (e.g., in a text box inside the object). Change-Id: I2702693595acf4befdbd25ef07a9f7c444926aab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143297 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'test')
-rw-r--r--test/source/xmltesttools.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx
index a79b039332dd..26973b440c61 100644
--- a/test/source/xmltesttools.cxx
+++ b/test/source/xmltesttools.cxx
@@ -183,13 +183,19 @@ void XmlTestTools::assertXPathAttrs(const xmlDocUniquePtr& pXmlDoc, const OStrin
}
}
-void XmlTestTools::assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, int nNumberOfNodes)
+int XmlTestTools::countXPathNodes(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath)
{
xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath);
xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval;
- CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(),
- nNumberOfNodes, xmlXPathNodeSetGetLength(pXmlNodes));
+ const int n = xmlXPathNodeSetGetLength(pXmlNodes);
xmlXPathFreeObject(pXmlObj);
+ return n;
+}
+
+void XmlTestTools::assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, int nNumberOfNodes)
+{
+ CPPUNIT_ASSERT_EQUAL_MESSAGE(OString(OString::Concat("In <") + pXmlDoc->name + ">, XPath '" + rXPath + "' number of nodes is incorrect").getStr(),
+ nNumberOfNodes, countXPathNodes(pXmlDoc, rXPath));
}
void XmlTestTools::assertXPathContent(const xmlDocUniquePtr& pXmlDoc, const OString& rXPath, const OUString& rContent)