summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-04-30 20:30:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-05-01 15:42:28 +0200
commitce17ecbfa6f578debcf8aec9d6c29836adb49c6f (patch)
tree3397d1d84a6ebd39e01c84f7366d77f26826b544
parent38a1c6b760d9664e0ecbce23b3d869fb77e7fc35 (diff)
ofz#47111 Timeout
Change-Id: Ic50978f5189ea2079d8cc2b5d0803ef4baf4ea4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133665 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx8
1 files changed, 4 insertions, 4 deletions
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<int>(16, std::ceil(5 * nEstimatedFinalFontSize));
SAL_WARN("svx", "CalculateHorizontalScalingFactor skipping direct to: " << nFontSize << " from " << rFontHeight.GetHeight());
}
}