[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 29 10:11:43 UTC 2018


 sw/source/core/layout/layact.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 19a0698079fbba36646a2d06eaec3a7fde60b2f5
Author:     Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Mon Oct 29 09:05:26 2018 +0100
Commit:     Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Mon Oct 29 11:11:21 2018 +0100

    tdf#120735 sw: clear the font cache text glyphs when layout finished
    
    The motivation for remembering the text glyphs was to avoid repeated layout
    calls during one sw layout run, this still preserves that optimization.
    
    Approximate numbers for memory usage after importing the bugdoc finished:
    
    - old: 401MB
    
    - new 366MB (91% of baseline)
    
    Change-Id: Ie960c606a8246c9c696745b2dcc9a49c3c570c07
    Reviewed-on: https://gerrit.libreoffice.org/62496
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins

diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 3923725ee9a2..d4cd2b349b87 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -58,6 +58,7 @@
 #include <acmplwrd.hxx>
 #include <sortedobjs.hxx>
 #include <objectformatter.hxx>
+#include <fntcache.hxx>
 #include <vector>
 
 // Save some typing work to avoid accessing destroyed pages.
@@ -2271,6 +2272,9 @@ SwLayIdle::SwLayIdle( SwRootFrame *pRt, SwViewShellImp *pI ) :
             pRoot->ResetIdleFormat();
             SfxObjectShell* pDocShell = pImp->GetShell()->GetDoc()->GetDocShell();
             pDocShell->Broadcast( SfxEventHint( SfxEventHintId::SwEventLayoutFinished, SwDocShell::GetEventName(STR_SW_EVENT_LAYOUT_FINISHED), pDocShell ) );
+            // Limit lifetime of the text glyphs cache to a single run of the
+            // layout.
+            SwClearFntCacheTextGlyphs();
         }
     }
 


More information about the Libreoffice-commits mailing list