diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-04-20 19:21:08 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-04-21 10:55:17 +0200 |
commit | ed5adb367ed0070d06312bce3ec3f44ec87a2361 (patch) | |
tree | 8f75e7810073f802cd207c973ac7f795a98a6461 /sw | |
parent | 77ce7aaa30d20abc1e6221a60ce5e69a52bfaf19 (diff) |
sw: fix crashtesting assert on fdo44018-2.doc
itrpaint.cxx:435: void SwTextPainter::DrawTextLine(): Assertion `!roTaggedParagraph' failed.
The problem is that there are in fact 3 lines with the numbering bullet,
which is a problem that existed since LO 4.1, but that only changed the
WW8 import so it really exists all the way back to OOo 3.0.1.
The SwNumberingPortion is created, then it is cloned for the insertion
of the tab, then the 2nd one is deleted (which is expected as it is
empty), then due to some ChkFlyUnderflow() SwTextFormatter::FormatLine()
resets the m_bNumDone flag and the next line gets another numbering.
The m_bNumDone flag must be reset if the numbering portion was deleted,
but not otherwise.
(regression from commit 9b38beadf9eaf027b201cdf0ecb2bce5611014dd)
Change-Id: I575947fdfb8786ad6d0f9e83636c39eb929a1b06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150709
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/itrform2.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index f4cbe364ebe6..f2c130ac4194 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -1980,7 +1980,15 @@ TextFrameIndex SwTextFormatter::FormatLine(TextFrameIndex const nStartPos) || GetInfo().CheckFootnotePortion(m_pCurr); if( bBuild ) { - GetInfo().SetNumDone( bOldNumDone ); + // fdo44018-2.doc: only restore m_bNumDone if a SwNumberPortion will be truncated + for (SwLinePortion * pPor = m_pCurr->GetNextPortion(); pPor; pPor = pPor->GetNextPortion()) + { + if (pPor->InNumberGrp()) + { + GetInfo().SetNumDone( bOldNumDone ); + break; + } + } GetInfo().ResetMaxWidthDiff(); // delete old rest |