diff options
author | László Németh <nemeth@numbertext.org> | 2019-05-21 13:36:22 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-05-22 07:39:40 +0200 |
commit | 2d3a907973d04f0b8368a132d262e0318c4445dc (patch) | |
tree | 479b5ac4c5a5ec01aa43779655092cf2181a471d | |
parent | 1d6cc7d95261fc910dc99959c5a99119c5363b16 (diff) |
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@numbertext.org>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf121784.docx | bin | 0 -> 5937 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 17 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 5 |
3 files changed, 21 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf121784.docx b/sw/qa/extras/ooxmlexport/data/tdf121784.docx Binary files differnew file mode 100644 index 000000000000..30faeb2841b9 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf121784.docx 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& ) |