diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-04-04 13:15:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-04-04 15:54:57 +0200 |
commit | a52b1610009096c171b7571b9c2e8c307cada90b (patch) | |
tree | 08c596dd3f16872562fd6fda9b50bfe6794db617 | |
parent | 321dac0b80c875247ae064e023d107d3ac1caef3 (diff) |
Resolves: tdf#148336 portion width can be zero
Change-Id: I9dcbf024882a0ca055d1847345ab2b8084d5871d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132510
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index e1c33c85cf2f..e4009930bfbb 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -2001,11 +2001,12 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf ) else rInf.SetKanaDiff( 0 ); - aTextSize.setWidth(aKernArray[sal_Int32(nLn) - 1]); - - - if ( rInf.GetKern() && nLn ) - aTextSize.AdjustWidth((sal_Int32(nLn) - 1) * rInf.GetKern()); + if (nLn) + { + aTextSize.setWidth(aKernArray[sal_Int32(nLn) - 1]); + if (rInf.GetKern()) + aTextSize.AdjustWidth((sal_Int32(nLn) - 1) * rInf.GetKern()); + } OSL_ENSURE( !rInf.GetShell() || ( USHRT_MAX != GetGuessedLeading() && USHRT_MAX != GetExternalLeading() ), |