diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-12-20 16:04:00 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-12-20 20:00:51 +0100 |
commit | 0aca74c0acc3e1c3f6099f47bfe9bfedfa7bf86d (patch) | |
tree | d82fb5b3d2ebaadc111d2ce90f24a7aa53814bd3 /sw | |
parent | 14eeed686c5490ddbd356c1ac807b16231e4cb88 (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
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 3 |
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()) |