svx/source/sdr/properties/groupproperties.cxx | 16 ++++++---------- sw/source/core/attr/swatrset.cxx | 10 ++++------ 2 files changed, 10 insertions(+), 16 deletions(-)
New commits: commit adc3cbe787f18c57e0e3c19d178e26db33b5bc54 Author: Noel Grandin <[email protected]> AuthorDate: Mon Feb 23 17:15:15 2026 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Mon Feb 23 19:47:24 2026 +0100 use more SfxItemIter which is more efficient when all we want is the SET items Change-Id: I0d90090e9501922ccf9b89674f3aa7bae4c1c012 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200068 Reviewed-by: Noel Grandin <[email protected]> Tested-by: Jenkins diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx index f7f49dcef96e..b819716cedee 100644 --- a/sw/source/core/attr/swatrset.cxx +++ b/sw/source/core/attr/swatrset.cxx @@ -38,6 +38,7 @@ #include <o3tl/unit_conversion.hxx> #include <osl/diagnose.h> #include <svl/whiter.hxx> +#include <svl/itemiter.hxx> #include <svx/svdpool.hxx> #include <svx/sxenditm.hxx> @@ -198,14 +199,11 @@ std::unique_ptr<SfxItemSet> SwAttrSet::Clone( bool bItems, SfxItemPool *pToPool pTmpSet.reset(new SwAttrSet( *pAttrPool, GetRanges() )); if ( bItems ) { - SfxWhichIter aIter(*pTmpSet); - sal_uInt16 nWhich = aIter.FirstWhich(); - while ( nWhich ) + for (SfxItemIter aIter(*pTmpSet); !aIter.IsAtEnd(); aIter.Next()) { - const SfxPoolItem* pItem; - if ( SfxItemState::SET == GetItemState( nWhich, false, &pItem ) ) + const SfxPoolItem *pItem = aIter.GetCurItem(); + if(!IsDisabledItem(pItem)) pTmpSet->Put( *pItem ); - nWhich = aIter.NextWhich(); } } } commit 471259c32ed6d230c3bc10903f26a2320bc23afe Author: Noel Grandin <[email protected]> AuthorDate: Mon Feb 23 16:58:57 2026 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Mon Feb 23 19:47:16 2026 +0100 use more SfxItemIter which is more efficient when all we want is the SET items Change-Id: I874cc30ad114a81ae325caf21b575e45586b4856 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200065 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/svx/source/sdr/properties/groupproperties.cxx b/svx/source/sdr/properties/groupproperties.cxx index 41852c2bd42d..51e6a7d922e9 100644 --- a/svx/source/sdr/properties/groupproperties.cxx +++ b/svx/source/sdr/properties/groupproperties.cxx @@ -21,7 +21,7 @@ #include <sdr/properties/groupproperties.hxx> #include <svl/itemset.hxx> -#include <svl/whiter.hxx> +#include <svl/itemiter.hxx> #include <svx/svdogrp.hxx> #include <svx/svdpage.hxx> #include <osl/diagnose.h> @@ -72,21 +72,17 @@ namespace sdr::properties for (const rtl::Reference<SdrObject>& pObj : *pSub) { const SfxItemSet& rSet = pObj->GetMergedItemSet(); - SfxWhichIter aIter(rSet); - sal_uInt16 nWhich(aIter.FirstWhich()); - - while(nWhich) + for (SfxItemIter aIter(rSet); !aIter.IsAtEnd(); aIter.Next()) { - if(SfxItemState::INVALID == aIter.GetItemState(false)) + const SfxPoolItem *pItem = aIter.GetCurItem(); + if(IsInvalidItem(pItem)) { - moMergedItemSet->InvalidateItem(nWhich); + moMergedItemSet->InvalidateItem(aIter.GetCurWhich()); } else { - moMergedItemSet->MergeValue(rSet.Get(nWhich)); + moMergedItemSet->MergeValue(rSet.Get(aIter.GetCurWhich())); } - - nWhich = aIter.NextWhich(); } }
