sw/source/core/txtnode/fntcache.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 5fc43fe24c24c58e401707fa6fffe9250186b99c
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Jan 18 14:45:20 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Jan 18 22:01:44 2022 +0100

    can use the glyphcache for this GetTextArray call
    
    Change-Id: Ibe7c7ce788074e0990f3857e97a9ee037484577f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128564
    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 cb68f6535635..f40072e26b8d 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2091,11 +2091,13 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
     {
         if( !m_pPrtFont->IsSameInstance( rInf.GetOut().GetFont() ) )
             rInf.GetOut().SetFont( *m_pPrtFont );
+        SwTextGlyphsKey aGlyphsKey{ &rInf.GetOut(), rInf.GetText(), 
sal_Int32(rInf.GetIdx()), sal_Int32(nLn) };
         if( bCompress )
         {
             std::vector<sal_Int32> aKernArray;
+            SalLayoutGlyphs* pGlyphs = GetCachedSalLayoutGlyphs(aGlyphsKey);
             rInf.GetOut().GetTextArray( rInf.GetText(), &aKernArray,
-                                sal_Int32(rInf.GetIdx()), sal_Int32(nLn));
+                                sal_Int32(rInf.GetIdx()), sal_Int32(nLn), 
nullptr, pGlyphs);
             rInf.SetKanaDiff( rInf.GetScriptInfo()->Compress( 
aKernArray.data(),
                 rInf.GetIdx(), nLn, rInf.GetKanaComp(),
                 o3tl::narrowing<sal_uInt16>(m_aFont.GetFontSize().Height()) 
,lcl_IsFullstopCentered( rInf.GetOut() ) ) );
@@ -2103,7 +2105,6 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
         }
         else
         {
-            SwTextGlyphsKey aGlyphsKey{ &rInf.GetOut(), rInf.GetText(), 
sal_Int32(rInf.GetIdx()), sal_Int32(nLn) };
             aTextSize.setWidth( GetCachedTextWidth(aGlyphsKey, 
rInf.GetVclCache()));
             rInf.SetKanaDiff( 0 );
         }

Reply via email to