summaryrefslogtreecommitdiff
path: root/chart2/source/view/main
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-10-04 18:35:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-10-05 07:02:24 +0200
commita36173359d4614a8935e2f764acadfcf736e091c (patch)
treec54e163e56201aa10c9abd29db74b90a35962b43 /chart2/source/view/main
parent0ab5a5ee6e7cafa0c0d3e5ffee809e6b77af3796 (diff)
tdf#151283 calc hangs when try to open XLS file
regression from commit 258a8d133d0548c7af51f4852260e9969df288fc Author: Noel Grandin <noel.grandin@collabora.co.uk> tdf#150034 very slow opening pathological chart if nNewLen is < 10, we can get stuck in an infinite loop because the calculation will not actually decrement nNewLen Change-Id: I98920deaa087713c44531a7f6506d1d5d32b2e98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140949 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/view/main')
-rw-r--r--chart2/source/view/main/VLegend.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index 1cfa1848d024..061cbb39976d 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -448,7 +448,7 @@ awt::Size lcl_placeLegendEntries(
DrawModelWrapper::removeShape(xEntry);
// The intention here is to make pathological cases with extremely large labels
// converge a little faster
- if (std::abs(nRemainingSpace) > nSumHeight / 10)
+ if (nNewLen > 10 && std::abs(nRemainingSpace) > nSumHeight / 10)
nNewLen -= nNewLen / 10;
else
--nNewLen;