[Libreoffice-commits] core.git: sw/qa writerfilter/source
László Németh (via logerrit)
logerrit at kemper.freedesktop.org
Thu Apr 15 12:10:27 UTC 2021
sw/qa/extras/ooxmlexport/data/tdf141660.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 11 +++++++++++
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 8 +++++++-
writerfilter/source/ooxml/OOXMLFastContextHandler.cxx | 3 ++-
4 files changed, 20 insertions(+), 2 deletions(-)
New commits:
commit 79aa866b184678e3d306d64da59a7deb54c41aef
Author: László Németh <nemeth at numbertext.org>
AuthorDate: Thu Apr 15 11:20:27 2021 +0200
Commit: László Németh <nemeth at numbertext.org>
CommitDate: Thu Apr 15 14:09:44 2021 +0200
tdf#141660 DOCX import: fix footnotes of deletions
Footnotes of tracked deletions resulted exception
during import. They don't need redline copying, because
the anchor point (the footnote index) is already part of
a redline.
Note: handle also remaining unhandled w:footnote type
"separationNotice", which could result shift of the
footnote numbering.
Regression from commit 9b39ce0e66acfe812e1d50e530dc2ccdef3e1357
(tdf#76260 DOCX import: fix slow footnote import).
Change-Id: I01e06fb25aba4f97cca31b5da34f5a7a3f18a54a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114137
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth at numbertext.org>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf141660.docx b/sw/qa/extras/ooxmlexport/data/tdf141660.docx
new file mode 100644
index 000000000000..dbcceeebd2f5
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf141660.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index 943938f67307..280d29f3d596 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -1306,6 +1306,17 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf121597TrackedDeletionOfMultipleParagr
assertXPath(pXmlDoc, "/w:document/w:body/w:p[10]/w:pPr/w:rPr/w:del");
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf141660, "tdf141660.docx")
+{
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+ xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[2]/w:footnoteReference", "id", "2");
+ // w:del is imported correctly with its footnote
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:del[2]/w:r/w:footnoteReference", "id", "3");
+ assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r/w:footnoteReference", "id", "4");
+}
+
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf133643, "tdf133643.doc")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index b446190c50b6..b9dbda9f1677 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2944,7 +2944,13 @@ static void lcl_PasteRedlines(
xCrsr->goRight(redPos[i/3], false);
xCrsr->goRight(redLen[i/3], true);
uno::Reference < text::XRedline > xRedline( xCrsr, uno::UNO_QUERY_THROW );
- xRedline->makeRedline( sType, aRedlineProperties );
+ try {
+ xRedline->makeRedline( sType, aRedlineProperties );
+ }
+ catch(const uno::Exception&)
+ {
+ // ignore (footnotes of tracked deletions)
+ }
}
}
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 0263196e6d8c..2c48f121b066 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -170,7 +170,8 @@ void SAL_CALL OOXMLFastContextHandler::startFastElement
// send uFtnSep to sign new footnote content, but skip footnote separators
if (!Attribs->hasAttribute(W_TOKEN(type)) ||
( Attribs->getValue(W_TOKEN(type)) != "separator" &&
- Attribs->getValue(W_TOKEN(type)) != "continuationSeparator" ))
+ Attribs->getValue(W_TOKEN(type)) != "continuationSeparator" &&
+ Attribs->getValue(W_TOKEN(type)) != "continuationNotice" ))
{
mpParserState->setStartFootnote(true);
}
More information about the Libreoffice-commits
mailing list