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

László Németh (via logerrit) logerrit at kemper.freedesktop.org
Wed May 22 05:40:16 UTC 2019


 sw/qa/extras/ooxmlexport/data/tdf121784.docx      |binary
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx        |   17 +++++++++++++++++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |    5 ++++-
 3 files changed, 21 insertions(+), 1 deletion(-)

New commits:
commit 2d3a907973d04f0b8368a132d262e0318c4445dc
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Tue May 21 13:36:22 2019 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Wed May 22 07:39:40 2019 +0200

    tdf#121784 DOCX import: fix change tracking of footnotes
    
    and endnotes by creating redline data for their anchors, too.
    
    Now footnote/endnote insertions are visible, and it's possible
    to reject them.
    
    Change-Id: I5cd3300c0d423b8c6803b7aeb848dcc103c3b565
    Reviewed-on: https://gerrit.libreoffice.org/72680
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf121784.docx b/sw/qa/extras/ooxmlexport/data/tdf121784.docx
new file mode 100644
index 000000000000..30faeb2841b9
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf121784.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index b056ad16071d..b7d5132c47c2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -306,6 +306,23 @@ DECLARE_OOXMLEXPORT_TEST(testTdf125298, "tdf125298_crossreflink_nonascii_charlim
     CPPUNIT_ASSERT_EQUAL(expectedFieldName2, fieldName2);
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf121784, "tdf121784.docx")
+{
+    // check tracked insertion of footnotes
+    CPPUNIT_ASSERT_EQUAL( OUString( "Text1" ), getParagraph( 1 )->getString());
+    CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 1 ), 2 )->getString());
+    CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(1), 2), "RedlineType"));
+    CPPUNIT_ASSERT_EQUAL(OUString("Insert"),getProperty<OUString>(getRun(getParagraph(1), 2), "RedlineType"));
+    CPPUNIT_ASSERT_EQUAL( OUString( "1" ), getRun( getParagraph( 1 ), 3 )->getString());
+
+    // check tracked insertion of endnotes
+    CPPUNIT_ASSERT_EQUAL( OUString( "texti" ), getParagraph( 2 )->getString());
+    CPPUNIT_ASSERT_EQUAL( OUString( "" ), getRun( getParagraph( 2 ), 2 )->getString());
+    CPPUNIT_ASSERT(hasProperty(getRun(getParagraph(2), 2), "RedlineType"));
+    CPPUNIT_ASSERT_EQUAL(OUString("Insert"),getProperty<OUString>(getRun(getParagraph(2), 2), "RedlineType"));
+    CPPUNIT_ASSERT_EQUAL( OUString( "i" ), getRun( getParagraph( 2 ), 3 )->getString());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 772ff5bdf3c6..eb852bf943d4 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2039,8 +2039,11 @@ void DomainMapper_Impl::PushFootOrEndnote( bool bIsFootnote )
         m_aTextAppendStack.push(TextAppendContext(uno::Reference< text::XTextAppend >( xFootnoteText, uno::UNO_QUERY_THROW ),
                     xFootnoteText->createTextCursorByRange(xFootnoteText->getStart())));
 
-        // Redlines for the footnote anchor
+        // Redlines for the footnote anchor in the main text content
+        std::vector< RedlineParamsPtr > aFootnoteRedline = m_aRedlines.top();
+        m_aRedlines.pop();
         CheckRedline( xFootnote->getAnchor( ) );
+        m_aRedlines.push( aFootnoteRedline );
 
     }
     catch( const uno::Exception& )


More information about the Libreoffice-commits mailing list