summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/source/inc/StylesPreviewWindow.hxx2
-rw-r--r--svx/source/tbxctrls/StylesPreviewWindow.cxx6
2 files changed, 6 insertions, 2 deletions
diff --git a/svx/source/inc/StylesPreviewWindow.hxx b/svx/source/inc/StylesPreviewWindow.hxx
index 3b652dcfb0d0..b59ad94041e7 100644
--- a/svx/source/inc/StylesPreviewWindow.hxx
+++ b/svx/source/inc/StylesPreviewWindow.hxx
@@ -24,6 +24,7 @@
#include <svl/style.hxx>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <sfx2/sfxstatuslistener.hxx>
+#include <vcl/glyphitemcache.hxx>
class StylesPreviewWindow_Base;
@@ -59,6 +60,7 @@ 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 ba338ffb22bc..8996b0083628 100644
--- a/svx/source/tbxctrls/StylesPreviewWindow.cxx
+++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx
@@ -340,14 +340,16 @@ void StyleItemController::DrawHighlight(vcl::RenderContext& rRenderContext, Colo
void StyleItemController::DrawText(vcl::RenderContext& rRenderContext)
{
+ const SalLayoutGlyphs* layoutGlyphs
+ = m_GlyphsCache.GetLayoutGlyphs(&rRenderContext, m_aStyleName.second);
tools::Rectangle aTextRect;
- rRenderContext.GetTextBoundRect(aTextRect, m_aStyleName.second);
+ rRenderContext.GetTextBoundRect(aTextRect, m_aStyleName.second, 0, 0, -1, 0, {}, layoutGlyphs);
Point aPos(0, 0);
aPos.AdjustX(LEFT_MARGIN);
aPos.AdjustY((rRenderContext.GetOutputHeightPixel() - aTextRect.Bottom()) / 2);
- rRenderContext.DrawText(aPos, m_aStyleName.second);
+ rRenderContext.DrawText(aPos, m_aStyleName.second, 0, -1, nullptr, nullptr, layoutGlyphs);
}
StylesPreviewWindow_Base::StylesPreviewWindow_Base(