sw/qa/extras/ooxmlexport/data/tdf153891.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport6.cxx | 5 +++++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-)
New commits: commit d93c8a047fbb7ace91761bdf8b7b818b5f62aff1 Author: László Németh <nem...@numbertext.org> AuthorDate: Wed Mar 1 14:11:30 2023 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Mar 6 09:45:16 2023 +0000 tdf#153891 DOCX import: crash fix at missing cell properties Regression from commit 81ce88aa80f8e7cde4fdc5b211e9500a3599643c "tdf#132514 DOCX import: fix lost table style with footer". Note: no crash without this fix by removing styles.xml from the test document. Change-Id: I7fd7edfc8f62e6b17c0c8f7a3bdec7d986ba57eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148053 Tested-by: Jenkins Reviewed-by: László Németh <nem...@numbertext.org> (cherry picked from commit e34074feeb1b918ab9f26a18c5fdb0b1f2e35f94) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148105 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 2a7ec5f17e01041418262dcb0229fe537fa8139f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148109 diff --git a/sw/qa/extras/ooxmlexport/data/tdf153891.docx b/sw/qa/extras/ooxmlexport/data/tdf153891.docx new file mode 100644 index 000000000000..6fe8092982b6 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf153891.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx index c54580ee766a..2f0da6cfa0a0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx @@ -518,6 +518,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132514) assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[2]/w:p[2]/w:pPr/w:spacing", "after", "0"); } +DECLARE_OOXMLEXPORT_TEST(testTdf153891, "tdf153891.docx") +{ + // This document simply crashed the importer. +} + CPPUNIT_TEST_FIXTURE(Test, testFdo69636) { loadAndSave("fdo69636.docx"); diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 0f0f3c5d1d1a..bf170d9ccf61 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -1429,7 +1429,9 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab if (bApply) { bool bEndOfApply = (xTextRangeCompare->compareRegionEnds(rEndPara, aIt->m_rEndParagraph) == 0); - ApplyParagraphPropertiesFromTableStyle(*aIt, aAllTableParaProperties, aCellProperties[nRow][nCell]); + // tdf#153891 handle missing cell properties (exception in style handling?) + if ( nCell < sal::static_int_cast<std::size_t>(aCellProperties[nRow].getLength()) ) + ApplyParagraphPropertiesFromTableStyle(*aIt, aAllTableParaProperties, aCellProperties[nRow][nCell]); // erase processed paragraph from list of pending paragraphs aIt = pTableParagraphs->erase(aIt); if (bEndOfApply)