mirror of
https://github.com/LibreOffice/core.git
synced 2025-08-15 20:47:46 +00:00
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.kaganski@collabora.com>
This commit is contained in:
@ -227,11 +227,12 @@ static void GetLimitedStringPart(const SwTextFormatInfo& rInf, TextFrameIndex nI
|
||||
TextFrameIndex nLength, sal_uInt16 nComp, SwTwips nOriginalWidth,
|
||||
SwTwips nMaxWidth, TextFrameIndex& rOutLength, SwTwips& 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);
|
||||
|
Reference in New Issue
Block a user