summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-05-10 13:15:15 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-05-10 19:03:09 +0200
commit21e6aea941d297545b1acd6592e0769af2b4d8a6 (patch)
tree9d331ec209818c2bdf8f6eaad8f95001672f3907
parentef692c98d43aeb861afb5b01f62e46344e835cb2 (diff)
sw: fix crashtesting assert on moz386569-2.odt
itrpaint.cxx:434: SwTextPainter::DrawTextLine: Assertion `!roTaggedParagraph' failed. The list item has the soft hyphen as a bullet char. Surprisingly this creates a SwSoftHyphPortion followed by an empty SwNumberPortion. (regression from commit 9b38beadf9eaf027b201cdf0ecb2bce5611014dd) Change-Id: Id58687c7e968a8a77ed5fab85d4c20d239174569 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151608 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--sw/source/core/text/itrpaint.cxx4
-rw-r--r--sw/source/core/text/porlay.cxx4
2 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 8bfe1631db72..827f8d4fcfd2 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -405,7 +405,9 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
}
// multiple numbering portions are possible :(
- if (pPor->InNumberGrp() // also footnote label
+ if ((pPor->InNumberGrp() // also footnote label
+ // weird special case, bullet with soft hyphen
+ || (pPor->InHyphGrp() && pNext && pNext->InNumberGrp()))
&& !roTaggedLabel) // note: CalcPaintOfst may skip some portions
{
assert(isPDFTaggingEnabled);
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 7111709aa6bc..d00dcc4992c0 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -2695,6 +2695,10 @@ bool SwParaPortion::HasNumberingPortion(FootnoteOrNot const eFootnote) const
pPortion = pPortion->GetNextPortion();
}
}
+ if (pPortion && pPortion->InHyphGrp())
+ { // weird special case, bullet with soft hyphen
+ pPortion = pPortion->GetNextPortion();
+ }
return pPortion && pPortion->InNumberGrp()
&& (eFootnote == SwParaPortion::FootnoteToo || !pPortion->IsFootnoteNumPortion());
}