sw/source/core/txtnode/fntcache.cxx |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

New commits:
commit 556e70024df6ca092e199a3769100c0982ad7567
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Jan 18 14:49:40 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sat Mar 12 20:33:13 2022 +0100

    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 <caol...@redhat.com>

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() );
     }

Reply via email to