sw/qa/extras/layout/data/tdf117923.doc |binary sw/qa/extras/layout/layout.cxx | 15 +++++++++++++++ sw/source/filter/ww8/ww8par.cxx | 3 +++ test/source/xmltesttools.cxx | 7 ++++++- 4 files changed, 24 insertions(+), 1 deletion(-)
New commits: commit aeacbbee40de4009c60a28e39c3698eeeb85f566 Author: Mike Kaganski <mike.kagan...@collabora.com> Date: Mon Jul 2 20:31:32 2018 +1000 tdf#117923: handle direct formatting for numbering in .doc Since commit df07d6cb9f62c0a2c4b29bd850d4efb4fcd4790b, we do for DOCX. DOC also has this problem, so set the relevant compatibility flag on import for this format, too. Change-Id: I3aef593341edffa878a06566da815cb72aa38004 Reviewed-on: https://gerrit.libreoffice.org/56812 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/57048 Tested-by: Aron Budea <aron.bu...@collabora.com> Reviewed-by: Aron Budea <aron.bu...@collabora.com> diff --git a/sw/qa/extras/layout/data/tdf117923.doc b/sw/qa/extras/layout/data/tdf117923.doc new file mode 100644 index 000000000000..c43cf40c9f52 Binary files /dev/null and b/sw/qa/extras/layout/data/tdf117923.doc differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 9a73e2025147..6344a29fd1d4 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -19,11 +19,13 @@ public: void testTdf116830(); void testTdf116925(); void testTdf117028(); + void testTdf117923(); CPPUNIT_TEST_SUITE(SwLayoutWriter); CPPUNIT_TEST(testTdf116830); CPPUNIT_TEST(testTdf116925); CPPUNIT_TEST(testTdf117028); + CPPUNIT_TEST(testTdf117923); CPPUNIT_TEST_SUITE_END(); private: @@ -108,6 +110,19 @@ void SwLayoutWriter::testTdf117028() assertXPathContent(pXmlDoc, "//textarray/text", "Hello"); } +void SwLayoutWriter::testTdf117923() +{ + createDoc("tdf117923.doc"); + xmlDocPtr pXmlDoc = parseLayoutDump(); + + // Check that we actually test the line we need + assertXPathContent(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]", "GHI GHI GHI GHI"); + assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]/Special", "nType", "POR_NUMBER"); + assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]/Special", "rText", "2."); + // The numbering height was 960. + assertXPath(pXmlDoc, "/root/page/body/tab/row/cell/txt[3]/Special", "nHeight", "220"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwLayoutWriter); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 5aebb80ee873..7e9c686b67e8 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1804,6 +1804,9 @@ void SwWW8ImplReader::ImportDop() m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::TAB_COMPAT, true); // #i24363# tab stops relative to indent m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::TABS_RELATIVE_TO_INDENT, false); + // tdf#117923 + m_rDoc.getIDocumentSettingAccess().set( + DocumentSettingId::APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, true); // Import Default Tabs long nDefTabSiz = m_xWDop->dxaTab; diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx index 57baa91fe9f6..7a6f035fc986 100644 --- a/test/source/xmltesttools.cxx +++ b/test/source/xmltesttools.cxx @@ -88,7 +88,12 @@ OUString XmlTestTools::getXPathContent(xmlDocPtr pXmlDoc, const OString& rXPath) xmlXPathNodeSetGetLength(pXmlNodes) > 0); xmlNodePtr pXmlNode = pXmlNodes->nodeTab[0]; - OUString s(convert((pXmlNode->children[0]).content)); + xmlNodePtr pXmlChild = pXmlNode->children; + OUString s; + while (pXmlChild && pXmlChild->type != XML_TEXT_NODE) + pXmlChild = pXmlChild->next; + if (pXmlChild && pXmlChild->type == XML_TEXT_NODE) + s = convert(pXmlChild->content); xmlXPathFreeObject(pXmlObj); return s; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits