summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-10-29 09:05:26 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-10-29 11:11:21 +0100
commit19a0698079fbba36646a2d06eaec3a7fde60b2f5 (patch)
tree4426832160455201fc5c62c7e2fe34c3a8de0573 /sw
parente503ed2c530a3e91ad6a8b93efac727ea0207019 (diff)
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@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/layout/layact.cxx4
1 files changed, 4 insertions, 0 deletions
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();
}
}