sw/source/core/text/portxt.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit 5ef1e5fd5e168d33e336b96b8d2feb89181a6cdd Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Wed Mar 5 16:58:06 2025 +0500 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Mar 13 21:41:11 2025 +0100 tdf#165582: nMaxWidth may be negative Change-Id: Ibe4a57e8a098b219e2662d3ce8645d5caef98123 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182536 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> (cherry picked from commit f6f1c7eb64a5b4ee44278e77e59305878979cfaa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182872 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 24d7c6bd1561de150dd1ab33e624f1d2cab0d3ef) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182882 Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index cf28eba10da8..45b2e1a92646 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -214,11 +214,12 @@ static void GetLimitedStringPart(const SwTextFormatInfo& rInf, TextFrameIndex nI sal_uInt16 nOriginalWidth, SwTwips nMaxWidth, TextFrameIndex& rOutLength, sal_uInt16& rOutWidth) { - assert(nMaxWidth >= 0); assert(nLength >= TextFrameIndex(0)); const SwScriptInfo& rSI = rInf.GetParaPortion()->GetScriptInfo(); rOutLength = nLength; rOutWidth = nOriginalWidth; + if (nMaxWidth < 0) + nMaxWidth = 0; while (rOutWidth > nMaxWidth) { TextFrameIndex nNewOnLineLengthGuess(rOutLength.get() * nMaxWidth / rOutWidth);