diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-02-05 21:02:38 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-02-05 21:02:38 +0100 |
commit | 352fc0ae2866eb0b222d90d51299c05222af8df5 (patch) | |
tree | f380e60061577468e1ba50c34fc61d57b495accd | |
parent | 73f4ef48d065c4108de4af52a4dc7d86815b9b05 (diff) |
SfxItemSet::operator == should return bool
...and need not be virtual
Change-Id: I8cf38c4942526c6ca66595fdc3297be750ec09a0
-rw-r--r-- | include/svl/itemset.hxx | 2 | ||||
-rw-r--r-- | svl/source/items/itemset.cxx | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx index 26ba3f33fe84..7157ecfabf56 100644 --- a/include/svl/itemset.hxx +++ b/include/svl/itemset.hxx @@ -143,7 +143,7 @@ public: const SfxItemPool *pRefPool = 0 ); virtual SvStream & Store( SvStream &, bool bDirect = false ) const; - virtual int operator==(const SfxItemSet &) const; + bool operator==(const SfxItemSet &) const; }; inline void SfxItemSet::SetParent( const SfxItemSet* pNew ) diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index e4155cc35d1d..268af3877be7 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -1627,7 +1627,7 @@ SvStream &SfxItemSet::Load // ----------------------------------------------------------------------- -int SfxItemSet::operator==(const SfxItemSet &rCmp) const +bool SfxItemSet::operator==(const SfxItemSet &rCmp) const { DBG_CHKTHIS(SfxItemSet, DbgCheckItemSet); DBG_CHKOBJ(&rCmp, SfxItemSet, DbgCheckItemSet); @@ -1636,13 +1636,13 @@ int SfxItemSet::operator==(const SfxItemSet &rCmp) const if ( _pParent != rCmp._pParent || _pPool != rCmp._pPool || Count() != rCmp.Count() ) - return sal_False; + return false; // Ranges durchzaehlen lassen dauert laenger, muss aber auch gleich sein sal_uInt16 nCount1 = TotalCount(); sal_uInt16 nCount2 = rCmp.TotalCount(); if ( nCount1 != nCount2 ) - return sal_False; + return false; // sind die Ranges selbst ungleich? for ( sal_uInt16 nRange = 0; _pWhichRanges[nRange]; nRange += 2 ) @@ -1664,15 +1664,15 @@ int SfxItemSet::operator==(const SfxItemSet &rCmp) const ( !pItem1 || IsInvalidItem(pItem1) || ( _pPool->IsItemFlag(*pItem1, SFX_ITEM_POOLABLE) && *pItem1 != *pItem2 ) ) ) ) - return sal_False; + return false; } - return sal_True; + return true; } // Pointer alle gleich? if ( 0 == memcmp( _aItems, rCmp._aItems, nCount1 * sizeof(_aItems[0]) ) ) - return sal_True; + return true; // dann werden wir wohl alle einzeln vergleichen muessen const SfxPoolItem **ppItem1 = (const SfxPoolItem**) _aItems; @@ -1686,13 +1686,13 @@ int SfxItemSet::operator==(const SfxItemSet &rCmp) const ( IsInvalidItem(*ppItem1) || IsInvalidItem(*ppItem2) ) || ( _pPool->IsItemFlag(**ppItem1, SFX_ITEM_POOLABLE) ) || **ppItem1 != **ppItem2 ) ) - return sal_False; + return false; ++ppItem1; ++ppItem2; } - return sal_True; + return true; } // ----------------------------------------------------------------------- |