summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-08-15 21:49:01 +0200
committerMichael Stahl <mstahl@redhat.com>2017-08-16 00:11:16 +0200
commit8aae35170281c8b8799f64db749d89155315cf7d (patch)
tree733ebb451eb8c3ed71b5ceb5700f4d687d96c925
parentf42200a08a733ad592a5587043b052882e17fc45 (diff)
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@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--svl/source/items/itemset.cxx3
1 files changed, 2 insertions, 1 deletions
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();