From ce17ecbfa6f578debcf8aec9d6c29836adb49c6f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 30 Apr 2022 20:30:08 +0100 Subject: ofz#47111 Timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic50978f5189ea2079d8cc2b5d0803ef4baf4ea4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133665 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'svx/source/customshapes') diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 9f212299c512..0043b69cd646 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -242,11 +242,11 @@ static void CalculateHorizontalScalingFactor( // skip directly to a small font size if (nFontSize > 128) { - int nEstimatedFinalFontSize = std::ceil(nFontSize * fScalingFactor); - int nFontThth = nFontSize / 1000; - if (nEstimatedFinalFontSize < nFontThth) + double nEstimatedFinalFontSize = nFontSize * fScalingFactor; + double nOnePercentFontSize = nFontSize / 100.0; + if (nEstimatedFinalFontSize < nOnePercentFontSize) { - nFontSize = std::max(16, nFontThth); + nFontSize = std::max(16, std::ceil(5 * nEstimatedFinalFontSize)); SAL_WARN("svx", "CalculateHorizontalScalingFactor skipping direct to: " << nFontSize << " from " << rFontHeight.GetHeight()); } } -- cgit