svx/source/svdraw/svdotext.cxx | 3 +++ 1 file changed, 3 insertions(+)
New commits: commit 34c2e782e19f96230fe14f59c28f255d0f53e25c Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Sat Apr 29 11:05:00 2023 +0900 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Mon May 1 07:46:25 2023 +0200 Prevent to get 0 font size in the auto-fitting algorithm When the text box is empty, the size of the box can be returned as (0,0) so the auto-fitting algorithm will calculate the scaling to 0%, which means the text is shrinked to very small size or is invisible. This change fixes the issue so that if the size is (0,0) we just return and leave the scaling at 100%. Change-Id: Ie359461f23a1f7a496eb03b5670f588ad48bbf49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151178 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> (cherry picked from commit fd99725abdeea92e8cd46bb3e8e6fdcad8180e8a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151180 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index d9a80a9cfb0b..f979818ee073 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1376,6 +1376,9 @@ void SdrTextObj::autoFitTextForCompatibility(SdrOutliner& rOutliner, const Size& } Size aCurrentTextBoxSize = rOutliner.CalcTextSizeNTP(); + if (aCurrentTextBoxSize.Height() == 0) + return; + tools::Long nExtendTextBoxBy = -50; aCurrentTextBoxSize.extendBy(0, nExtendTextBoxBy); double fCurrentFitFactor = double(rTextBoxSize.Height()) / aCurrentTextBoxSize.Height();