summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-04-07 12:06:27 +0200
committerLuboš Luňák <l.lunak@collabora.com>2022-04-08 21:29:19 +0200
commit3e5863605881c6de6ad130fe06883c176ca1c69f (patch)
tree9e7863107a162eba8952710af00c281b91a12633 /svx
parent53fe4a26c7c4691fcf9d07d022adfd45247d176b (diff)
use just one shared global SalLayoutGlyphsCache
Now the cache should be capable of detecting what needs to stay the same for having the same result, so it should be enough to have just one cache that can reuse results even between callers from different places. Change-Id: Ibdc0303f5b727d1a1d7be91d61db9465ed95e1c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132673 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/inc/StylesPreviewWindow.hxx2
-rw-r--r--svx/source/tbxctrls/StylesPreviewWindow.cxx3
2 files changed, 2 insertions, 3 deletions
diff --git a/svx/source/inc/StylesPreviewWindow.hxx b/svx/source/inc/StylesPreviewWindow.hxx
index b59ad94041e7..3b652dcfb0d0 100644
--- a/svx/source/inc/StylesPreviewWindow.hxx
+++ b/svx/source/inc/StylesPreviewWindow.hxx
@@ -24,7 +24,6 @@
#include <svl/style.hxx>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <sfx2/sfxstatuslistener.hxx>
-#include <vcl/glyphitemcache.hxx>
class StylesPreviewWindow_Base;
@@ -60,7 +59,6 @@ class StyleItemController
SfxStyleFamily m_eStyleFamily;
std::pair<OUString, OUString> m_aStyleName;
- SalLayoutGlyphsCache m_GlyphsCache;
public:
StyleItemController(const std::pair<OUString, OUString>& aStyleName);
diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx b/svx/source/tbxctrls/StylesPreviewWindow.cxx
index 8ad09344aa0f..ffd6d1e9b0ed 100644
--- a/svx/source/tbxctrls/StylesPreviewWindow.cxx
+++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx
@@ -27,6 +27,7 @@
#include <sfx2/sfxsids.hrc>
#include <sfx2/tplpitem.hxx>
#include <sfx2/viewsh.hxx>
+#include <vcl/glyphitemcache.hxx>
#include <vcl/virdev.hxx>
#include <vcl/settings.hxx>
@@ -354,7 +355,7 @@ void StyleItemController::DrawHighlight(vcl::RenderContext& rRenderContext, Colo
void StyleItemController::DrawText(vcl::RenderContext& rRenderContext)
{
const SalLayoutGlyphs* layoutGlyphs
- = m_GlyphsCache.GetLayoutGlyphs(&rRenderContext, m_aStyleName.second);
+ = SalLayoutGlyphsCache::self()->GetLayoutGlyphs(&rRenderContext, m_aStyleName.second);
tools::Rectangle aTextRect;
rRenderContext.GetTextBoundRect(aTextRect, m_aStyleName.second, 0, 0, -1, 0, {}, layoutGlyphs);