writerfilter/source/rtftok/rtfdocumentimpl.cxx | 1 + 1 file changed, 1 insertion(+)
New commits: commit e85453e5319d5072a49ba6749fabdc804eaf64e8 Author: Michael Stahl <michael.st...@allotropia.de> AuthorDate: Wed Feb 7 13:04:14 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Fri Feb 9 14:53:30 2024 +0100 tdf#158586 writerfilter: RTF import: fix assert on ooo113308-1.rtf warn:legacy.osl:::writerfilter/source/dmapper/DomainMapper_Impl.cxx:1278: section stack already empty DomainMapper_Impl.cxx:9817: void writerfilter::dmapper::DomainMapper_Impl::substream(): Assertion `m_aContextStack.size() == contextSize' failed. Before substream(), there is one CONTEXT_SECTION, after there is an additional CONTEXT_PARAGRPAH. The first OSL_ENSURE is because RTFDocumentImpl::tableBreak() calls endParagraphGroup() but in the substream, startParagraphGroup() hadn't been called; fixing this also makes the assert failure go away. This worked previously because sectBreak() called endParagraphGroup() after reading the header substreams, but it seems dubious that a paragraph group started in the body should be used in the substream. (regression from commit 57abad5cf990111fd7de011809d4421dc0550193) Change-Id: I98864bca03b59099c17080c0a7582de2b77d41e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163096 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@allotropia.de> (cherry picked from commit 6446d3e12440be39e6b55f8749038061a1b240da) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163138 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 91b2df21ba21..059aa037041d 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -654,6 +654,7 @@ void RTFDocumentImpl::runBreak() void RTFDocumentImpl::tableBreak() { + checkFirstRun(); // ooo113308-1.rtf has a header at offset 151084 that doesn't startParagraphGroup() without this runBreak(); Mapper().endParagraphGroup(); Mapper().startParagraphGroup();