summaryrefslogtreecommitdiffstats
path: root/vcl/source/gdi/impglyphitem.cxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-05-16 13:11:17 +0200
committerLuboš Luňák <l.lunak@collabora.com>2022-05-16 21:14:47 +0200
commitbe441f1a8c40ecbd99653043aa443fc1130d91c2 (patch)
treef61a086feebb4b9e1f17480249175e972576e93d /vcl/source/gdi/impglyphitem.cxx
parentFix a UITest on Windows (diff)
downloadcore-be441f1a8c40ecbd99653043aa443fc1130d91c2.tar.gz
core-be441f1a8c40ecbd99653043aa443fc1130d91c2.zip
use FontMetric as SalLayoutGlyphsCache key rather than vcl::Font
Apparently even calling OutputDevice::GetFontMetric() rather than GetFont() makes a difference with e.g. tdf#65046-1, when only vcl::Font is used it triggers the assert in checkGlyphsEqual() because of the fonts actually being different. Change-Id: I2a2aba6bf6d4bf78b7449ccdb16be0746663ee87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134401 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/source/gdi/impglyphitem.cxx')
-rw-r--r--vcl/source/gdi/impglyphitem.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index 648696a55107..6ab5663ddef6 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -450,7 +450,7 @@ SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(
, logicWidth(w)
// we also need to save things used in OutputDevice::ImplPrepareLayoutArgs(), in case they
// change in the output device, plus mapMode affects the sizes.
- , font(outputDevice->GetFont())
+ , fontMetric(outputDevice->GetFontMetric())
// TODO It would be possible to get a better hit ratio if mapMode wasn't part of the key
// and results that differ only in mapmode would have coordinates adjusted based on that.
// That would occasionally lead to rounding errors (at least differences that would
@@ -471,7 +471,7 @@ SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(
o3tl::hash_combine(hashValue, outputDevice.get());
// Need to use IgnoreColor, because sometimes the color changes, but it's irrelevant
// for text layout (and also obsolete in vcl::Font).
- o3tl::hash_combine(hashValue, font.GetHashValueIgnoreColor());
+ o3tl::hash_combine(hashValue, fontMetric.GetHashValueIgnoreColor());
// For some reason font scale may differ even if vcl::Font is the same,
// so explicitly check it too.
o3tl::hash_combine(hashValue, fontScaleX);
@@ -488,7 +488,7 @@ inline bool SalLayoutGlyphsCache::CachedGlyphsKey::operator==(const CachedGlyphs
&& logicWidth == other.logicWidth && mapMode == other.mapMode && rtl == other.rtl
&& layoutMode == other.layoutMode && digitLanguage == other.digitLanguage
&& fontScaleX == other.fontScaleX && fontScaleY == other.fontScaleY
- && font.EqualIgnoreColor(other.font)
+ && fontMetric.EqualIgnoreColor(other.fontMetric)
&& vcl::text::FastStringCompareEqual()(text, other.text);
// Slower things last in the comparison.
}