summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-04-25 11:53:29 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-04-26 15:49:00 +0200
commit2e1e14b7d0fab28858a54340636de01ed6eb4bc0 (patch)
tree1b5209d95999c174615eae191df7a2bf6df649d8
parentb1c80b5c0973563c8cbf7c305aef493e9d3f7c0d (diff)
ofz#46901 Timeout
Change-Id: I458ddb6ee4d7023f60c8d1c26699bbd74502ddc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133375 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 70fff24c9ba0..9f212299c512 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -240,10 +240,15 @@ static void CalculateHorizontalScalingFactor(
{
// if we have a very large font that will require scaling down to a very small value then
// skip directly to a small font size
- if (nFontSize > 128 && fScalingFactor * nFontSize < 1.0)
+ if (nFontSize > 128)
{
- nFontSize = 16;
- SAL_WARN("svx", "CalculateHorizontalScalingFactor skipping direct to: " << nFontSize << " from " << rFontHeight.GetHeight());
+ int nEstimatedFinalFontSize = std::ceil(nFontSize * fScalingFactor);
+ int nFontThth = nFontSize / 1000;
+ if (nEstimatedFinalFontSize < nFontThth)
+ {
+ nFontSize = std::max(16, nFontThth);
+ SAL_WARN("svx", "CalculateHorizontalScalingFactor skipping direct to: " << nFontSize << " from " << rFontHeight.GetHeight());
+ }
}
nFontSize--;
aFont.SetFontHeight( nFontSize );