diff options
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/itemiter.cxx | 17 | ||||
-rw-r--r-- | svl/source/items/itemset.cxx | 12 |
2 files changed, 11 insertions, 18 deletions
diff --git a/svl/source/items/itemiter.cxx b/svl/source/items/itemiter.cxx index aaedcf26ae33..fe0ee377f439 100644 --- a/svl/source/items/itemiter.cxx +++ b/svl/source/items/itemiter.cxx @@ -50,17 +50,14 @@ SfxItemIter::~SfxItemIter() { } -const SfxPoolItem* SfxItemIter::NextItem() +// Precondition : m_nCurrent < m_nEnd +const SfxPoolItem* SfxItemIter::ImplNextItem() { - if (m_nCurrent < m_nEnd) - { - SfxPoolItem const** ppFnd = m_rSet.m_pItems.get(); - do { - m_nCurrent++; - } while (m_nCurrent < m_nEnd && !*(ppFnd + m_nCurrent )); - return *(ppFnd+m_nCurrent); - } - return nullptr; + SfxPoolItem const** ppFnd = m_rSet.m_pItems.get(); + do { + m_nCurrent++; + } while (m_nCurrent < m_nEnd && !*(ppFnd + m_nCurrent )); + return *(ppFnd+m_nCurrent); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index 35da205612ac..f325cec50f34 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -1014,17 +1014,15 @@ void SfxItemSet::Intersect( const SfxItemSet& rSet ) { SfxItemIter aIter( *this ); const SfxPoolItem* pItem = aIter.GetCurItem(); - while( true ) + do { sal_uInt16 nWhich = IsInvalidItem( pItem ) ? GetWhichByPos( aIter.GetCurPos() ) : pItem->Which(); if( SfxItemState::UNKNOWN == rSet.GetItemState( nWhich, false ) ) ClearItem( nWhich ); // Delete - if( aIter.IsAtEnd() ) - break; pItem = aIter.NextItem(); - } + } while (pItem); } } @@ -1080,17 +1078,15 @@ void SfxItemSet::Differentiate( const SfxItemSet& rSet ) { SfxItemIter aIter( *this ); const SfxPoolItem* pItem = aIter.GetCurItem(); - while( true ) + do { sal_uInt16 nWhich = IsInvalidItem( pItem ) ? GetWhichByPos( aIter.GetCurPos() ) : pItem->Which(); if( SfxItemState::SET == rSet.GetItemState( nWhich, false ) ) ClearItem( nWhich ); // Delete - if( aIter.IsAtEnd() ) - break; pItem = aIter.NextItem(); - } + } while (pItem); } } |