summaryrefslogtreecommitdiff
path: root/tools/source
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-04-11 12:43:05 +0200
committerLuboš Luňák <l.lunak@collabora.com>2022-04-12 13:31:09 +0200
commit3361db2179dfe4ddb017ac59660c26c2acaaac8d (patch)
treed873f6eb2eb675255389be4f35f90f3180d8999b /tools/source
parentcbaf1fbaa6e707d939f815eda360fad68a492aca (diff)
include OutputDevice MapMode in SalLayoutGlyphsCache key (tdf#148400)
The mapmode also affects the layout of the glyphs. Change-Id: I9492bc4d3d9e991ef8ab5dc30ce424e44cbc79f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132822 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'tools/source')
-rw-r--r--tools/source/generic/fract.cxx10
-rw-r--r--tools/source/generic/gen.cxx9
2 files changed, 19 insertions, 0 deletions
diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx
index 49c26c0f1be4..7f2ffba1003d 100644
--- a/tools/source/generic/fract.cxx
+++ b/tools/source/generic/fract.cxx
@@ -19,6 +19,7 @@
#include <tools/fract.hxx>
#include <tools/debug.hxx>
+#include <o3tl/hash_combine.hxx>
#include <o3tl/safeint.hxx>
#include <sal/log.hxx>
#include <osl/diagnose.h>
@@ -473,4 +474,13 @@ static void rational_ReduceInaccurate(boost::rational<sal_Int32>& rRational, uns
rRational.assign( bNeg ? -nMul : nMul, nDiv );
}
+size_t Fraction::GetHashValue() const
+{
+ size_t hash = 0;
+ o3tl::hash_combine( hash, mnNumerator );
+ o3tl::hash_combine( hash, mnDenominator );
+ o3tl::hash_combine( hash, mbValid );
+ return hash;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index b3331b7b4e4d..27120d6abbd1 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -22,6 +22,7 @@
#include <algorithm>
#include <tuple>
+#include <o3tl/hash_combine.hxx>
#include <o3tl/safeint.hxx>
#include <tools/gen.hxx>
@@ -33,6 +34,14 @@ OString Pair::toString() const
return OString::number(A()) + ", " + OString::number(B());
}
+size_t Pair::GetHashValue() const
+{
+ size_t hash = 0;
+ o3tl::hash_combine( hash, nA );
+ o3tl::hash_combine( hash, nB );
+ return hash;
+}
+
void tools::Rectangle::SetSize( const Size& rSize )
{
if ( rSize.Width() < 0 )