[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - sw/qa writerfilter/source

Serge Krot (via logerrit) logerrit at kemper.freedesktop.org
Fri Mar 29 10:25:04 UTC 2019


 sw/qa/extras/ooxmlexport/data/tdf121456.docx      |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx        |   10 ++++++++++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    3 +++
 3 files changed, 13 insertions(+)

New commits:
commit cc9ff57ee111f8a931e70a6bb592adbf7403d830
Author:     Serge Krot <Serge.Krot at cib.de>
AuthorDate: Wed Mar 27 14:02:51 2019 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Mar 29 11:24:36 2019 +0100

    tdf#121456 sw: DOCX: fix loading of empty TOC title
    
    Change-Id: Ib241edd07e4c6781d80db274f73146bda310d8c0
    Reviewed-on: https://gerrit.libreoffice.org/69827
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit e47a5543f4b8c9e317d1e43af8c0e5a732e461fd)
    Reviewed-on: https://gerrit.libreoffice.org/69902

diff --git a/sw/qa/extras/ooxmlexport/data/tdf121456.docx b/sw/qa/extras/ooxmlexport/data/tdf121456.docx
new file mode 100644
index 000000000000..a65870a9b719
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf121456.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 51d847229698..f4a300bc50b3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -152,6 +152,16 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121561_tocTitle, "tdf121456_tabsOffset.odt")
     assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:docPartObj/w:docPartUnique", 1);
 }
 
+// Related issue tdf#121561: w:sdt/w:sdtContent around TOC
+DECLARE_OOXMLEXPORT_TEST(testTdf124106, "tdf121456.docx")
+{
+    uno::Reference<text::XTextDocument> textDocument(mxComponent, uno::UNO_QUERY);
+    uno::Reference<text::XText> text(textDocument->getText(), uno::UNO_QUERY);
+    // -1 if the 'Y' character does not occur
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), text->getString().indexOf('Y'));
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), text->getString().indexOf('y'));
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf121561_tocTitleDocx, "tdf121456_tabsOffset.odt")
 {
     xmlDocPtr pXmlDoc = parseExport();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 756f3d18333e..59f23b01faf1 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3856,6 +3856,9 @@ void DomainMapper_Impl::handleToc
     {
         if (aTocTitle.isEmpty() || bTableOfFigures)
         {
+            // reset marker of the TOC title
+            m_xStdEntryStart = uno::Reference< text::XTextRange >();
+
             xTOC.set(
                     m_xTextFactory->createInstance
                     ( bTableOfFigures ?


More information about the Libreoffice-commits mailing list