From bcd27039eec660fce2abd7604cdb8cd36ae4cdba Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 28 May 2022 13:36:41 +0200 Subject: use the new SfxWhichIter::GetItemState feature to speed up other places that are iterating over SfxItemSets Change-Id: I646bae12420d15e67effdd279e071cdf8a8afffd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135075 Tested-by: Jenkins Reviewed-by: Noel Grandin --- editeng/source/rtf/svxrtf.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'editeng/source') diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index cae8e4361ad0..bb07beae826c 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -652,7 +652,7 @@ void SvxRTFParser::ClearStyleAttr_( SvxRTFItemStackType& rStkType ) for( sal_uInt16 nWhich = aIter.GetCurWhich(); nWhich; nWhich = aIter.NextWhich() ) { if (SfxItemPool::IsWhich(nWhich) && - SfxItemState::SET == rSet.GetItemState( nWhich, false, &pItem ) && + SfxItemState::SET == aIter.GetItemState( false, &pItem ) && rPool.GetDefaultItem( nWhich ) == *pItem ) rSet.ClearItem( nWhich ); // delete } @@ -668,12 +668,12 @@ void SvxRTFParser::ClearStyleAttr_( SvxRTFItemStackType& rStkType ) { if( SfxItemState::SET == rStyleSet.GetItemState( nWhich, true, &pSItem )) { - if( SfxItemState::SET == rSet.GetItemState( nWhich, false, &pItem ) + if( SfxItemState::SET == aIter.GetItemState( false, &pItem ) && *pItem == *pSItem ) rSet.ClearItem( nWhich ); // delete } else if (SfxItemPool::IsWhich(nWhich) && - SfxItemState::SET == rSet.GetItemState( nWhich, false, &pItem ) && + SfxItemState::SET == aIter.GetItemState( false, &pItem ) && rPool.GetDefaultItem( nWhich ) == *pItem ) rSet.ClearItem( nWhich ); // delete } -- cgit