summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-12-20 16:04:00 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-12-23 10:32:02 +0100
commit8155efc399f12bffbbab23a2efc67e172bf08e9c (patch)
tree6ffa6adcce5d50a233bd664174f65d66f5c0f0c9 /sw/source
parent821e5733ce2149544fb6ff0b3d39923340f93fa7 (diff)
sw: fix SwTextGlyphsKey::operator==()
It assumed that the length of our text and the RHS's text is the same, but that may not be true. Originally introduced in commit c7b83934fcf4120c1a4cba8e1eaf9c7aef9edc82 (tdf#119992 sw: compare sub-strings in SwTextGlyphsKey comparison, 2018-10-12). Change-Id: I0361ec001aaffdbad6814bbbfefec6eaeb367f10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127163 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit 0aca74c0acc3e1c3f6099f47bfe9bfedfa7bf86d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127258 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/txtnode/fntcache.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index f2c18d7b1ce9..93e83c2013e9 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -91,7 +91,8 @@ bool SwTextGlyphsKey::operator==(SwTextGlyphsKey const & rhs) const
{
bool b = m_pOutputDevice.get() == rhs.m_pOutputDevice.get()
&& m_nIndex == rhs.m_nIndex
- && m_nLength == rhs.m_nLength;
+ && m_nLength == rhs.m_nLength
+ && m_aText.getLength() == rhs.m_aText.getLength();
if (!b)
return false;
if(m_nLength >= 0 && m_nIndex >= 0 && m_nIndex + m_nLength <= m_aText.getLength())