summaryrefslogtreecommitdiff
path: root/include
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 /include
parent60ab59ef593d7466250b91bd58c123a6a8f4a734 (diff)
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 'include')
-rw-r--r--include/vcl/glyphitemcache.hxx3
-rw-r--r--include/vcl/metric.hxx9
2 files changed, 11 insertions, 1 deletions
diff --git a/include/vcl/glyphitemcache.hxx b/include/vcl/glyphitemcache.hxx
index 138adb7bb40a..28c38d42ed07 100644
--- a/include/vcl/glyphitemcache.hxx
+++ b/include/vcl/glyphitemcache.hxx
@@ -26,6 +26,7 @@
#include <o3tl/lru_map.hxx>
#include <o3tl/hash_combine.hxx>
#include <vcl/glyphitem.hxx>
+#include <vcl/metric.hxx>
#include <vcl/outdev.hxx>
#include <vcl/vclptr.hxx>
#include <tools/gen.hxx>
@@ -69,7 +70,7 @@ private:
sal_Int32 index;
sal_Int32 len;
tools::Long logicWidth;
- vcl::Font font;
+ FontMetric fontMetric;
double fontScaleX;
double fontScaleY;
MapMode mapMode;
diff --git a/include/vcl/metric.hxx b/include/vcl/metric.hxx
index b08403da81a3..c8d95f88d6ef 100644
--- a/include/vcl/metric.hxx
+++ b/include/vcl/metric.hxx
@@ -68,7 +68,16 @@ public:
bool operator==( const FontMetric& rMetric ) const;
bool operator!=( const FontMetric& rMetric ) const
{ return !operator==( rMetric ); }
+
+ bool EqualIgnoreColor( const FontMetric& ) const;
+
+ // Compute value usable as hash.
+ size_t GetHashValue() const;
+ size_t GetHashValueIgnoreColor() const;
+
private:
+ bool EqualNoBase( const FontMetric& ) const;
+ size_t GetHashValueNoBase() const;
tools::Long mnAscent; // Ascent
tools::Long mnDescent; // Descent
tools::Long mnIntLeading; // Internal Leading