sw/qa/extras/ooxmlexport/data/tdf115557.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 9 +++++++ writerfilter/source/ooxml/OOXMLFastContextHandler.cxx | 23 ++++++++++-------- 3 files changed, 23 insertions(+), 9 deletions(-)
New commits: commit 8325764fb67ca192687e1fe1eba329deebe6aa07 Author: László Németh <nem...@numbertext.org> AuthorDate: Mon May 27 11:53:46 2019 +0200 Commit: László Németh <nem...@numbertext.org> CommitDate: Mon May 27 16:24:17 2019 +0200 tdf#115557 DOCX import: don't multiply charts in footnotes A chart in a footnote was appeared in every footnotes, resulting fatal problems during a few import/export cycles, see tdf#115558 (MSO is unable to open the DOCX export with multiplied objects). Change-Id: Ib729e4442ed3c92e4646fa7cdf7253a963d883e8 Reviewed-on: https://gerrit.libreoffice.org/73025 Tested-by: Jenkins Reviewed-by: László Németh <nem...@numbertext.org> diff --git a/sw/qa/extras/ooxmlexport/data/tdf115557.docx b/sw/qa/extras/ooxmlexport/data/tdf115557.docx new file mode 100644 index 000000000000..1edceac48547 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf115557.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 92657cd985a4..d6dc27cda24e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -1297,6 +1297,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf104354_2, "tdf104354-2.docx") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell5->getText()), "ParaBottomMargin")); } +DECLARE_OOXMLEXPORT_TEST(testTdf115557, "tdf115557.docx") +{ + // A chart anchored to a footnote multiplied during import + xmlDocPtr pXmlDoc = parseExport("word/footnotes.xml"); + if (!pXmlDoc) + return; + + assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing", 1); +} CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx index 4b9b8896f139..280f3245d687 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx @@ -1678,18 +1678,23 @@ void OOXMLFastContextHandlerShape::sendShape( Token_t Element ) void OOXMLFastContextHandlerShape::lcl_endFastElement (Token_t Element) { - if (mrShapeContext.is()) + if (isForwardEvents()) { - mrShapeContext->endFastElement(Element); - sendShape( Element ); - } - OOXMLFastContextHandlerProperties::lcl_endFastElement(Element); + if (mrShapeContext.is()) + { + mrShapeContext->endFastElement(Element); + sendShape( Element ); + } + + OOXMLFastContextHandlerProperties::lcl_endFastElement(Element); - // Ending the shape should be the last thing to do - bool bIsPicture = Element == ( NMSP_dmlPicture | XML_pic ); - if ( !bIsPicture && m_bShapeStarted) - mpStream->endShape( ); + // Ending the shape should be the last thing to do + bool bIsPicture = Element == ( NMSP_dmlPicture | XML_pic ); + if ( !bIsPicture && m_bShapeStarted) + mpStream->endShape( ); + + } } void SAL_CALL OOXMLFastContextHandlerShape::endUnknownElement _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits