[Libreoffice-commits] core.git: svl/source
Michael Stahl
mstahl at redhat.com
Tue Aug 15 22:12:45 UTC 2017
svl/source/items/itemset.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 8aae35170281c8b8799f64db749d89155315cf7d
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Aug 15 21:49:01 2017 +0200
SfxItemSet::Equal: ignore parents if the pools are different
If there are parents, they are necessarily different pointers for
different pools; the only sensible way to compare them is by-value,
which is a bit tricky because the items overwritten in the child
should of course be ignored.
Rather than rewrite the whole function, just ignore the parents for
now, because this comparison is currently used to replace compares
of the serializations of item sets, and SfxItemSet::Store()
completely ignores the m_pParent, so this looks like the best
replacement.
Change-Id: I0a4bf44d4fef49e47a3ec78bc7d977a6fcbd789d
Reviewed-on: https://gerrit.libreoffice.org/41186
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 72ae16c836bb..19e3f7a0cb12 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -1453,12 +1453,13 @@ bool SfxItemSet::Equals(const SfxItemSet &rCmp, bool bComparePool) const
{
// Values we can get quickly need to be the same
const bool bDifferentPools = (m_pPool != rCmp.m_pPool);
- if ( m_pParent != rCmp.m_pParent ||
+ if ( (bComparePool && m_pParent != rCmp.m_pParent) ||
(bComparePool && bDifferentPools) ||
Count() != rCmp.Count() )
return false;
// If we reach here and bDifferentPools==true that means bComparePool==false.
+ assert(!bDifferentPools || !bComparePool);
// Counting Ranges takes longer; they also need to be the same, however
sal_uInt16 nCount1 = TotalCount();
More information about the Libreoffice-commits
mailing list