From ca4f1929ced3714c99acc7c7458277459158683a Mon Sep 17 00:00:00 2001 From: Douglas Mencken Date: Sun, 15 Jun 2014 08:39:00 -0400 Subject: xmlChildElementCount is only available in libxml2 >= 2.7.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes build error Undefined symbols: _xmlChildElementCount Change-Id: I9687971912b4d0ae55bf1d9ad987fd339fcbec7e Reviewed-on: https://gerrit.libreoffice.org/9788 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- test/source/xmltesttools.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/source/xmltesttools.cxx') diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx index 0cb89f701201..129e286f4a53 100644 --- a/test/source/xmltesttools.cxx +++ b/test/source/xmltesttools.cxx @@ -98,6 +98,7 @@ void XmlTestTools::assertXPathContent(xmlDocPtr pXmlDoc, const OString& rXPath, void XmlTestTools::assertXPathChildren(xmlDocPtr pXmlDoc, const OString& rXPath, int nNumberOfChildNodes) { +#if LIBXML_VERSION >= 20703 /* xmlChildElementCount is only available in libxml2 >= 2.7.3 */ xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath); xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; CPPUNIT_ASSERT_EQUAL_MESSAGE(OString("XPath '" + rXPath + "' number of nodes is incorrect").getStr(), @@ -106,6 +107,11 @@ void XmlTestTools::assertXPathChildren(xmlDocPtr pXmlDoc, const OString& rXPath, CPPUNIT_ASSERT_EQUAL_MESSAGE(OString("XPath '" + rXPath + "' number of child-nodes is incorrect").getStr(), nNumberOfChildNodes, (int)xmlChildElementCount(pXmlNode)); xmlXPathFreeObject(pXmlObj); +#else + (void)pXmlDoc; + (void)rXPath; + (void)nNumberOfChildNodes; +#endif } int XmlTestTools::getXPathPosition(xmlDocPtr pXmlDoc, const OString& rXPath, const OUString& rChildName) -- cgit v1.2.3