ofz#46639 Timeout

Change-Id: I04f61749104bd21fa53edefd57a737d85c1d4faa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132898
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2022-04-12 12:14:28 +01:00
parent f0801aba21
commit 67a5469f1c

View File

@@ -173,6 +173,8 @@ static void CalculateHorizontalScalingFactor(
const SvxFontHeightItem& rFontHeight( rSdrObjCustomShape.GetMergedItem( EE_CHAR_FONTHEIGHT ) );
sal_Int32 nFontSize = rFontHeight.GetHeight();
SAL_WARN_IF(nFontSize > SAL_MAX_INT16, "svx", "CalculateHorizontalScalingFactor suspiciously large font height: " << nFontSize);
if (rFWData.bScaleX)
aFont.SetFontHeight( nFontSize );
else
@@ -236,6 +238,11 @@ static void CalculateHorizontalScalingFactor(
if (fScalingFactor < 1.0)
{
// if we have a ridiculously large font (flagged with the SAL_WARN
// above) that will require scaling down to a very small value then
// skip directly to a small font size
if (nFontSize > SAL_MAX_INT16 && fScalingFactor * nFontSize < 1.0)
nFontSize = 16;
nFontSize--;
aFont.SetFontHeight( nFontSize );
pVirDev->SetFont( aFont );