[Libreoffice-commits] core.git: sw/qa writerfilter/source

Serge Krot (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 28 12:08:42 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 e47a5543f4b8c9e317d1e43af8c0e5a732e461fd
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: Thu Mar 28 13:08:16 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>

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 a846bf70636d..d9e324b0e07f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -153,6 +153,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 be4c43385cd8..bfaab409a1c5 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