summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/tabfrm.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-09-30 20:22:30 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-10-01 06:33:11 +0200
commit1fc63383ccd8af144d681ba405f5ead863ac24e1 (patch)
tree77d41033131babef8db1dd7ffb6e00b0f0ac3237 /sw/source/core/layout/tabfrm.cxx
parent4814e8caa5f06c4fe438dfd7d7315e4a2410ea18 (diff)
Avoid redundant IsAtEnd: NextItem returns nullptr iif iterator is at end
To keep the check efficient, split NextItem to inline and Impl parts Change-Id: Id5877a3c5bed73aac9c39c655b106a715cf888ea Reviewed-on: https://gerrit.libreoffice.org/79894 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/core/layout/tabfrm.cxx')
-rw-r--r--sw/source/core/layout/tabfrm.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index bfe8a7a9e4ea..4395bd231900 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -3164,18 +3164,16 @@ void SwTabFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
SfxItemIter aNIter( *static_cast<const SwAttrSetChg*>(pNew)->GetChgSet() );
SfxItemIter aOIter( *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet() );
+ const SfxPoolItem* pNItem = aNIter.GetCurItem();
+ const SfxPoolItem* pOItem = aOIter.GetCurItem();
SwAttrSetChg aOldSet( *static_cast<const SwAttrSetChg*>(pOld) );
SwAttrSetChg aNewSet( *static_cast<const SwAttrSetChg*>(pNew) );
- while( true )
+ do
{
- UpdateAttr_( aOIter.GetCurItem(),
- aNIter.GetCurItem(), nInvFlags,
- &aOldSet, &aNewSet );
- if( aNIter.IsAtEnd() )
- break;
- aNIter.NextItem();
- aOIter.NextItem();
- }
+ UpdateAttr_(pOItem, pNItem, nInvFlags, &aOldSet, &aNewSet);
+ pNItem = aNIter.NextItem();
+ pOItem = aOIter.NextItem();
+ } while (pNItem);
if ( aOldSet.Count() || aNewSet.Count() )
SwLayoutFrame::Modify( &aOldSet, &aNewSet );
}