summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2021-07-20 09:51:47 +0200
committerLászló Németh <nemeth@numbertext.org>2021-07-20 15:59:26 +0200
commitf78a21df119603cd6db03f8544871c7a41f16864 (patch)
treed0716dfa4ef74195ae3f0fea7fb8f438eabfd1b5 /sw
parentae0c6da13c9b92757ff0f4ba360308ee50c701cf (diff)
tdf#143399 DOCX import: fix lost endnotes or footnotes
in a document containing both of them. Regression from commit 7dd8f8aace536a8e60e87e61ee1d90d61fba15eb "tdf#120351 DOCX import: fix slow endnote import". Change-Id: I0fe764f3b48dd2688afa4b7cf0ee6658737ef9fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119239 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 732b08b22eee2682351a9295be29188852fb0489) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119187 Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf143399.docxbin0 -> 14354 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport14.cxx17
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf143399.docx b/sw/qa/extras/ooxmlexport/data/tdf143399.docx
new file mode 100644
index 000000000000..191e46f36bb1
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf143399.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index e383984c1170..9944636960c0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -1160,6 +1160,23 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf141548, "tdf141548.docx")
assertXPathContent(pXml, "/w:endnotes/w:endnote[4]/w:p/w:r[2]/w:t[2]", "new line");
}
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf143399, "tdf143399.docx")
+{
+ xmlDocUniquePtr pXml = parseExport("word/footnotes.xml");
+ CPPUNIT_ASSERT(pXml);
+ // These were 0 (lost text content of documents both with footnotes and endnotes)
+ assertXPath(pXml, "/w:footnotes/w:footnote[3]/w:p/w:r[3]/w:t", 1);
+ assertXPathContent(pXml, "/w:footnotes/w:footnote[3]/w:p/w:r[3]/w:t", "Footnotes_graphic2");
+ assertXPath(pXml, "/w:footnotes/w:footnote[4]/w:p/w:r[3]/w:t", 1);
+ assertXPathContent(pXml, "/w:footnotes/w:footnote[4]/w:p/w:r[3]/w:t", "Footnotes_grahic");
+
+ xmlDocUniquePtr pXml2 = parseExport("word/endnotes.xml");
+ CPPUNIT_ASSERT(pXml);
+ // This was 0 (lost text content of the run with endnoteRef)
+ assertXPath(pXml2, "/w:endnotes/w:endnote[3]/w:p/w:r[3]/w:t", 1);
+ assertXPathContent(pXml2, "/w:endnotes/w:endnote[3]/w:p/w:r[3]/w:t[1]", "Endnotes");
+}
+
DECLARE_OOXMLEXPORT_TEST(testContSectBreakHeaderFooter, "cont-sect-break-header-footer.docx")
{
// Load a document with a continuous section break on page 2.