diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-30 17:17:46 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-10-30 18:33:51 +0100 |
commit | 7df33caac85ac90c26e97dedbc201f46dc9e4cb4 (patch) | |
tree | 6bfe454b05b6825860fd5c866d86384085a76ef4 /test | |
parent | 2b44debe150d5e4bd9777a9a55a8328512d4fb40 (diff) |
tdf#116989: disable conversion of tables in footers to floating for now
As the floating objects anchored to footers aren't wrapped around properly
(they behave as if they are wrapped through unconditionally), which makes
imported tables to overlap the page body text making the document unusable,
let's just disable the conversion for the time being (until the actual bug
fixed properly).
This also backports the unit test from https://gerrit.libreoffice.org/62544
(Change-Id Ia8b5478b0d2a15f91add4ee76455e73c2c970392).
Change-Id: I06c984ff7157b71fff2aa8122cc475a1199994c6
Reviewed-on: https://gerrit.libreoffice.org/62523
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/62628
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'test')
-rw-r--r-- | test/source/xmltesttools.cxx | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx index 45347b0c111b..ab373ccae96c 100644 --- a/test/source/xmltesttools.cxx +++ b/test/source/xmltesttools.cxx @@ -82,15 +82,40 @@ OUString XmlTestTools::getXPath(xmlDocPtr pXmlDoc, const OString& rXPath, const OUString XmlTestTools::getXPathContent(xmlDocPtr pXmlDoc, const OString& rXPath) { xmlXPathObjectPtr pXmlObj = getXPathNode(pXmlDoc, rXPath); - xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; + switch (pXmlObj->type) + { + case XPATH_UNDEFINED: + CPPUNIT_FAIL("Undefined XPath type"); + case XPATH_NODESET: + { + xmlNodeSetPtr pXmlNodes = pXmlObj->nodesetval; - CPPUNIT_ASSERT_MESSAGE(OString("In <" + OString(pXmlDoc->name) + ">, XPath '" + rXPath + "' not found").getStr(), - xmlXPathNodeSetGetLength(pXmlNodes) > 0); + CPPUNIT_ASSERT_MESSAGE( + OString("In <" + OString(pXmlDoc->name) + ">, XPath '" + rXPath + "' not found") + .getStr(), + xmlXPathNodeSetGetLength(pXmlNodes) > 0); - xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; - OUString s(convert((pXmlNode->children[0]).content)); - xmlXPathFreeObject(pXmlObj); - return s; + xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; + OUString s(convert(pXmlNode->children[0].content)); + xmlXPathFreeObject(pXmlObj); + return s; + } + case XPATH_BOOLEAN: + return pXmlObj->boolval ? OUString("true") : OUString("false"); + case XPATH_NUMBER: + return OUString::number(pXmlObj->floatval); + case XPATH_STRING: + return convert(pXmlObj->stringval); + case XPATH_POINT: + case XPATH_RANGE: + case XPATH_LOCATIONSET: + case XPATH_USERS: + case XPATH_XSLT_TREE: + CPPUNIT_FAIL("Unsupported XPath type"); + } + + CPPUNIT_FAIL("Invalid XPath type"); + return OUString(); // to suppress "Not all control paths return a value" warning on MSVC } void XmlTestTools::assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath, const OString& rAttribute, const OUString& rExpectedValue) |