diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-01-18 14:49:40 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-03-12 20:33:13 +0100 |
commit | 556e70024df6ca092e199a3769100c0982ad7567 (patch) | |
tree | 1e8238ee11f8d5d3add53b8220ce3b1d67a55afe | |
parent | de81df1f3f9b7660db450c638925f90adf9c026b (diff) |
set portion width using the last position in the dxarray
so both branches are consistent in measuring mechanism
Change-Id: Ie9b671ac69d00550d42328ac28c707c850238312
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128566
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index b99408177d0a..6082d978194a 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -1995,22 +1995,19 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf ) { if( !m_pPrtFont->IsSameInstance( rInf.GetOut().GetFont() ) ) rInf.GetOut().SetFont( *m_pPrtFont ); + + std::vector<sal_Int32> aKernArray; + + GetTextArray(rInf.GetOut(), rInf.GetText(), aKernArray, + sal_Int32(rInf.GetIdx()), sal_Int32(nLn), true); if( bCompress ) - { - std::vector<sal_Int32> aKernArray; - GetTextArray(rInf.GetOut(), rInf.GetText(), aKernArray, - sal_Int32(rInf.GetIdx()), sal_Int32(nLn), false); rInf.SetKanaDiff( rInf.GetScriptInfo()->Compress( aKernArray.data(), rInf.GetIdx(), nLn, rInf.GetKanaComp(), o3tl::narrowing<sal_uInt16>(m_aFont.GetFontSize().Height()) ,lcl_IsFullstopCentered( rInf.GetOut() ) ) ); - aTextSize.setWidth( aKernArray[sal_Int32(nLn) - 1] ); - } else - { - SwTextGlyphsKey aGlyphsKey{ &rInf.GetOut(), rInf.GetText(), sal_Int32(rInf.GetIdx()), sal_Int32(nLn) }; - aTextSize.setWidth( GetCachedTextWidth(aGlyphsKey, rInf.GetVclCache())); rInf.SetKanaDiff( 0 ); - } + + aTextSize.setWidth( aKernArray[sal_Int32(nLn) - 1] ); aTextSize.setHeight( rInf.GetOut().GetTextHeight() ); } |