chart2/source/controller/itemsetwrapper/ItemConverter.cxx |    5 +++--
 editeng/source/rtf/svxrtf.cxx                             |    6 +++---
 sc/source/core/tool/detfunc.cxx                           |    2 +-
 sd/source/filter/xml/sdtransform.cxx                      |    2 +-
 sd/source/ui/view/drawview.cxx                            |    4 ++--
 sd/source/ui/view/drviewsf.cxx                            |    2 +-
 sfx2/source/dialog/styledlg.cxx                           |    2 +-
 svl/source/items/itemset.cxx                              |    2 +-
 svx/source/engine3d/float3d.cxx                           |    2 +-
 svx/source/sdr/properties/attributeproperties.cxx         |    2 +-
 svx/source/sdr/properties/defaultproperties.cxx           |    2 +-
 svx/source/sdr/properties/e3dsceneproperties.cxx          |    2 +-
 svx/source/sdr/properties/groupproperties.cxx             |    2 +-
 svx/source/sdr/properties/itemsettools.cxx                |    2 +-
 svx/source/svdraw/svdedtv1.cxx                            |    6 +++---
 svx/source/svdraw/svdetc.cxx                              |    2 +-
 svx/source/svdraw/svdmodel.cxx                            |    2 +-
 svx/source/svdraw/svdpntv.cxx                             |    2 +-
 svx/source/svdraw/svdundo.cxx                             |    4 ++--
 svx/source/table/tablecontroller.cxx                      |    5 +++--
 sw/source/core/crsr/findattr.cxx                          |    4 ++--
 sw/source/core/text/redlnitr.cxx                          |    2 +-
 sw/source/core/txtnode/thints.cxx                         |   10 ++++++----
 sw/source/filter/html/css1atr.cxx                         |    2 +-
 sw/source/filter/html/htmlatr.cxx                         |    2 +-
 sw/source/filter/html/htmldrawwriter.cxx                  |    3 +--
 sw/source/filter/writer/wrt_fn.cxx                        |    2 +-
 sw/source/filter/ww8/docxattributeoutput.cxx              |    2 +-
 sw/source/filter/ww8/wrtw8esh.cxx                         |    2 +-
 sw/source/filter/ww8/wrtw8nds.cxx                         |    2 +-
 sw/source/filter/ww8/ww8atr.cxx                           |    2 +-
 31 files changed, 47 insertions(+), 44 deletions(-)

New commits:
commit bcd27039eec660fce2abd7604cdb8cd36ae4cdba
Author:     Noel Grandin <[email protected]>
AuthorDate: Sat May 28 13:36:41 2022 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat May 28 17:36:49 2022 +0200

    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 <[email protected]>

diff --git a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx 
b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
index e90fad016cfd..9ca38f4919e6 100644
--- a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx
@@ -198,7 +198,8 @@ void ItemConverter::InvalidateUnequalItems( SfxItemSet  
&rDestSet, const SfxItem
 
     while (nWhich)
     {
-        if ((rSourceSet.GetItemState(nWhich, true, &pPoolItem) == 
SfxItemState::SET) &&
+        SfxItemState nSourceItemState = aIter.GetItemState(true, &pPoolItem);
+        if ((nSourceItemState == SfxItemState::SET) &&
             (rDestSet.GetItemState(nWhich, true, &pPoolItem) == 
SfxItemState::SET))
         {
             if (rSourceSet.Get(nWhich) != rDestSet.Get(nWhich))
@@ -209,7 +210,7 @@ void ItemConverter::InvalidateUnequalItems( SfxItemSet  
&rDestSet, const SfxItem
                 }
             }
         }
-        else if( rSourceSet.GetItemState(nWhich, true, &pPoolItem) == 
SfxItemState::DONTCARE )
+        else if( nSourceItemState == SfxItemState::DONTCARE )
             rDestSet.InvalidateItem(nWhich);
 
         nWhich = aIter.NextWhich ();
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
         }
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index eabc91a3c4bb..9e700f41184e 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -242,7 +242,7 @@ void ScCommentData::UpdateCaptionSet( const SfxItemSet& 
rItemSet )
 
     for( sal_uInt16 nWhich = aWhichIter.FirstWhich(); nWhich > 0; nWhich = 
aWhichIter.NextWhich() )
     {
-        if(rItemSet.GetItemState(nWhich, false, &pPoolItem) == 
SfxItemState::SET)
+        if(aWhichIter.GetItemState(false, &pPoolItem) == SfxItemState::SET)
         {
             switch(nWhich)
             {
diff --git a/sd/source/filter/xml/sdtransform.cxx 
b/sd/source/filter/xml/sdtransform.cxx
index 13e3a957e27d..4e296eaf6282 100644
--- a/sd/source/filter/xml/sdtransform.cxx
+++ b/sd/source/filter/xml/sdtransform.cxx
@@ -225,7 +225,7 @@ void SdTransformOOo2xDocument::transformTextShape( 
SdrTextObj& rTextShape )
                     // now set all none hard attributes from the style
                     while(nWhich)
                     {
-                        if(SfxItemState::SET != aParaSet.GetItemState(nWhich))
+                        if(SfxItemState::SET != aIter.GetItemState())
                         {
                             aParaSet.Put(rStyleSet.Get(nWhich));
                             bItemChange = true;
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index dd711aeaef49..e4cdf010736c 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -363,7 +363,7 @@ void DrawView::SetMasterAttributes( SdrObject* pObject, 
const SdPage& rPage, Sfx
                     sal_uInt16 nWhich(aWhichIter.FirstWhich());
                     while( nWhich )
                     {
-                        if( SfxItemState::SET == rSet.GetItemState( nWhich ) )
+                        if( SfxItemState::SET == aWhichIter.GetItemState() )
                             aTempSet.ClearItem( nWhich );
                         nWhich = aWhichIter.NextWhich();
                     }
@@ -390,7 +390,7 @@ void DrawView::SetMasterAttributes( SdrObject* pObject, 
const SdPage& rPage, Sfx
             sal_uInt16 nWhich(aWhichIter.FirstWhich());
             while( nWhich )
             {
-                if( SfxItemState::SET == rSet.GetItemState( nWhich ) )
+                if( SfxItemState::SET == aWhichIter.GetItemState() )
                     pObject->ClearMergedItem( nWhich );
                 nWhich = aWhichIter.NextWhich();
             }
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index f23bd042ce23..ae47828e8be5 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -733,7 +733,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
         while( nWhich )
         {
             if (nWhich >= XATTR_LINE_FIRST && nWhich <= XATTR_LINE_LAST
-                && SfxItemState::DEFAULT == pSet->GetItemState(nWhich) )
+                && SfxItemState::DEFAULT == aNewIter.GetItemState() )
             {
                 rSet.ClearItem( nWhich );
                 rSet.DisableItem( nWhich );
diff --git a/sfx2/source/dialog/styledlg.cxx b/sfx2/source/dialog/styledlg.cxx
index 2614083f8f75..0e2551102a2a 100644
--- a/sfx2/source/dialog/styledlg.cxx
+++ b/sfx2/source/dialog/styledlg.cxx
@@ -93,7 +93,7 @@ IMPL_LINK_NOARG(SfxStyleDialogController, CancelHdl, 
weld::Button&, void)
 
     while (nWhich)
     {
-        SfxItemState eState = pInSet->GetItemState(nWhich, false);
+        SfxItemState eState = aIter.GetItemState(false);
 
         if (SfxItemState::DEFAULT == eState)
             m_xExampleSet->ClearItem(nWhich);
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index c96bac69c54d..842bc2d16623 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -1116,7 +1116,7 @@ void SfxItemSet::MergeValues( const SfxItemSet& rSet )
         while( 0 != ( nWhich = aIter.NextWhich() ) )
         {
             const SfxPoolItem* pItem = nullptr;
-            (void)rSet.GetItemState( nWhich, true, &pItem );
+            (void)aIter.GetItemState( true, &pItem );
             if( !pItem )
             {
                 // Not set, so default
diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx
index 266b1e135db1..0c0b8eeb8d85 100644
--- a/svx/source/engine3d/float3d.cxx
+++ b/svx/source/engine3d/float3d.cxx
@@ -1650,7 +1650,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
 
         while(nWhich)
         {
-            SfxItemState eState = mpRemember2DAttributes->GetItemState(nWhich, 
false);
+            SfxItemState eState = aIter.GetItemState(false);
             if(SfxItemState::DONTCARE == eState)
                 rAttrs.InvalidateItem(nWhich);
             else if(SfxItemState::SET == eState)
diff --git a/svx/source/sdr/properties/attributeproperties.cxx 
b/svx/source/sdr/properties/attributeproperties.cxx
index b7407d641d44..a6bcaf40da65 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -53,7 +53,7 @@ namespace sdr::properties
 
                     while(nWhich)
                     {
-                        if(SfxItemState::SET == rStyle.GetItemState(nWhich))
+                        if(SfxItemState::SET == aIter.GetItemState())
                         {
                             mxItemSet->ClearItem(nWhich);
                         }
diff --git a/svx/source/sdr/properties/defaultproperties.cxx 
b/svx/source/sdr/properties/defaultproperties.cxx
index 91a2edbfebc0..fa52924585c5 100644
--- a/svx/source/sdr/properties/defaultproperties.cxx
+++ b/svx/source/sdr/properties/defaultproperties.cxx
@@ -178,7 +178,7 @@ namespace sdr::properties
             while(nWhich)
             {
                 const SfxPoolItem* pPoolItem;
-                if(SfxItemState::SET == rSet.GetItemState(nWhich, false, 
&pPoolItem))
+                if(SfxItemState::SET == aWhichIter.GetItemState(false, 
&pPoolItem))
                 {
                     if(AllowItemChange(nWhich, pPoolItem))
                     {
diff --git a/svx/source/sdr/properties/e3dsceneproperties.cxx 
b/svx/source/sdr/properties/e3dsceneproperties.cxx
index a0887cc15aee..c156db33e029 100644
--- a/svx/source/sdr/properties/e3dsceneproperties.cxx
+++ b/svx/source/sdr/properties/e3dsceneproperties.cxx
@@ -85,7 +85,7 @@ namespace sdr::properties
                         // and always equal.
                         if(nWhich <= SDRATTR_3DSCENE_FIRST || nWhich >= 
SDRATTR_3DSCENE_LAST)
                         {
-                            if(SfxItemState::DONTCARE == 
rSet.GetItemState(nWhich, false))
+                            if(SfxItemState::DONTCARE == 
aIter.GetItemState(false))
                             {
                                 mxItemSet->InvalidateItem(nWhich);
                             }
diff --git a/svx/source/sdr/properties/groupproperties.cxx 
b/svx/source/sdr/properties/groupproperties.cxx
index 00f689515c4c..6ec522aa36b9 100644
--- a/svx/source/sdr/properties/groupproperties.cxx
+++ b/svx/source/sdr/properties/groupproperties.cxx
@@ -77,7 +77,7 @@ namespace sdr::properties
 
                 while(nWhich)
                 {
-                    if(SfxItemState::DONTCARE == rSet.GetItemState(nWhich, 
false))
+                    if(SfxItemState::DONTCARE == aIter.GetItemState(false))
                     {
                         mxItemSet->InvalidateItem(nWhich);
                     }
diff --git a/svx/source/sdr/properties/itemsettools.cxx 
b/svx/source/sdr/properties/itemsettools.cxx
index 3bc0deee38a7..11431d367d12 100644
--- a/svx/source/sdr/properties/itemsettools.cxx
+++ b/svx/source/sdr/properties/itemsettools.cxx
@@ -70,7 +70,7 @@ namespace sdr::properties
 
             while(nWhich)
             {
-                if(SfxItemState::SET == rSet.GetItemState(nWhich, false, 
&pItem))
+                if(SfxItemState::SET == aIter.GetItemState(false, &pItem))
                 {
                     if(pItem->HasMetrics())
                     {
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 2ec1bd1cf1d5..371584bd891a 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -925,12 +925,12 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, 
bool bOnlyHardAttr) con
         {
             if(!bOnlyHardAttr)
             {
-                if(SfxItemState::DONTCARE == rSet.GetItemState(nWhich, false))
+                if(SfxItemState::DONTCARE == aIter.GetItemState(false))
                     rAttr.InvalidateItem(nWhich);
                 else
                     rAttr.MergeValue(rSet.Get(nWhich), true);
             }
-            else if(SfxItemState::SET == rSet.GetItemState(nWhich, false))
+            else if(SfxItemState::SET == aIter.GetItemState(false))
             {
                 const SfxPoolItem& rItem = rSet.Get(nWhich);
                 rAttr.MergeValue(rItem, true);
@@ -1103,7 +1103,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& 
rAttr, bool bReplaceAll)
     sal_uInt16 nWhich = aIter.FirstWhich();
     while(!bPossibleGeomChange && nWhich)
     {
-        SfxItemState eState = rAttr.GetItemState(nWhich);
+        SfxItemState eState = aIter.GetItemState();
         if(eState == SfxItemState::SET)
         {
             if((nWhich >= SDRATTR_TEXT_MINFRAMEHEIGHT && nWhich <= 
SDRATTR_TEXT_CONTOURFRAME)
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index 929d59e09f4a..154bd3c7b084 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -368,7 +368,7 @@ bool SearchOutlinerItems(const SfxItemSet& rSet, bool 
bInklDefaults, bool* pbOnl
         // For bInklDefaults, the entire Which range is decisive,
         // in other cases only the set items are.
         // Disabled and DontCare are regarded as holes in the Which range.
-        SfxItemState eState=rSet.GetItemState(nWhich);
+        SfxItemState eState=aIter.GetItemState();
         if ((eState==SfxItemState::DEFAULT && bInklDefaults) || 
eState==SfxItemState::SET) {
             if (nWhich<EE_ITEMS_START || nWhich>EE_ITEMS_END) bOnly=false;
             else bHas=true;
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index bb28a23a558e..f5218c997ca6 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1636,7 +1636,7 @@ void SdrModel::MigrateItemSet( const SfxItemSet* 
pSourceSet, SfxItemSet* pDestSe
 
     while(nWhich)
     {
-        if(SfxItemState::SET == pSourceSet->GetItemState(nWhich, false, 
&pPoolItem))
+        if(SfxItemState::SET == aWhichIter.GetItemState(false, &pPoolItem))
         {
             std::unique_ptr<SfxPoolItem> pResultItem;
 
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 7843d52d49c1..f403ddd578ac 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -970,7 +970,7 @@ void SdrPaintView::SetDefaultStyleSheet(SfxStyleSheet* 
pStyleSheet, bool bDontRe
         SfxWhichIter aIter(pStyleSheet->GetItemSet());
         sal_uInt16 nWhich=aIter.FirstWhich();
         while (nWhich!=0) {
-            if 
(pStyleSheet->GetItemSet().GetItemState(nWhich)==SfxItemState::SET) {
+            if (aIter.GetItemState()==SfxItemState::SET) {
                 maDefaultAttr.ClearItem(nWhich);
             }
             nWhich=aIter.NextWhich();
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index bd2ff6d8c1f9..15c690427363 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -364,7 +364,7 @@ void SdrUndoAttrObj::Undo()
 
                 while(nWhich)
                 {
-                    if(SfxItemState::SET != moUndoSet->GetItemState(nWhich, 
false))
+                    if(SfxItemState::SET != aIter.GetItemState(false))
                     {
                         pObj->ClearMergedItem(nWhich);
                     }
@@ -445,7 +445,7 @@ void SdrUndoAttrObj::Redo()
 
                 while(nWhich)
                 {
-                    if(SfxItemState::SET != moRedoSet->GetItemState(nWhich, 
false))
+                    if(SfxItemState::SET != aIter.GetItemState(false))
                     {
                         pObj->ClearMergedItem(nWhich);
                     }
diff --git a/svx/source/table/tablecontroller.cxx 
b/svx/source/table/tablecontroller.cxx
index 8ef76acd377e..ef7401489c1d 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -2422,14 +2422,15 @@ void 
SvxTableController::MergeAttrFromSelectedCells(SfxItemSet& rAttr, bool bOnl
                 sal_uInt16 nWhich(aIter.FirstWhich());
                 while(nWhich)
                 {
+                    SfxItemState nState = aIter.GetItemState(false);
                     if(!bOnlyHardAttr)
                     {
-                        if(SfxItemState::DONTCARE == rSet.GetItemState(nWhich, 
false))
+                        if(SfxItemState::DONTCARE == nState)
                             rAttr.InvalidateItem(nWhich);
                         else
                             rAttr.MergeValue(rSet.Get(nWhich), true);
                     }
-                    else if(SfxItemState::SET == rSet.GetItemState(nWhich, 
false))
+                    else if(SfxItemState::SET == nState)
                     {
                         const SfxPoolItem& rItem = rSet.Get(nWhich);
                         rAttr.MergeValue(rItem, true);
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index ba5e6ac56d08..3f695280f814 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -346,7 +346,7 @@ bool SwAttrCheckArr::SetAttrFwd( const SwTextAttr& rAttr )
             pIter.reset(new SfxWhichIter( *pSet ));
             nWhch = pIter->FirstWhich();
             while( nWhch &&
-                SfxItemState::SET != pSet->GetItemState( nWhch, true, 
&pTmpItem ) )
+                SfxItemState::SET != pIter->GetItemState( true, &pTmpItem ) )
                 nWhch = pIter->NextWhich();
             if( !nWhch )
                 pTmpItem = nullptr;
@@ -506,7 +506,7 @@ bool SwAttrCheckArr::SetAttrBwd( const SwTextAttr& rAttr )
             pIter.reset( new SfxWhichIter( *pSet ) );
             nWhch = pIter->FirstWhich();
             while( nWhch &&
-                SfxItemState::SET != pSet->GetItemState( nWhch, true, 
&pTmpItem ) )
+                SfxItemState::SET != pIter->GetItemState( true, &pTmpItem ) )
                 nWhch = pIter->NextWhich();
             if( !nWhch )
                 pTmpItem = nullptr;
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index 3613469d7703..2a7a4b9309ac 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -749,7 +749,7 @@ short SwRedlineItr::Seek(SwFont& rFnt,
                     {
                         const SfxPoolItem* pItem;
                         if( ( nWhich < RES_CHRATR_END ) &&
-                            ( SfxItemState::SET == m_pSet->GetItemState( 
nWhich, true, &pItem ) ) )
+                            ( SfxItemState::SET == aIter.GetItemState( true, 
&pItem ) ) )
                         {
                             SwTextAttr* pAttr = MakeRedlineTextAttr(
                                 const_cast<SwDoc&>(m_rDoc),
diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index 0c774f83677f..edad6745b2e3 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -2018,10 +2018,11 @@ static void lcl_MergeAttr( SfxItemSet& rSet, const 
SfxPoolItem& rAttr )
         sal_uInt16 nWhich = aIter.FirstWhich();
         while( nWhich )
         {
+            const SfxPoolItem* pItem = nullptr;
             if( ( nWhich < RES_CHRATR_END ||
                   RES_TXTATR_UNKNOWN_CONTAINER == nWhich ) &&
-                ( SfxItemState::SET == pCFSet->GetItemState( nWhich ) ) )
-                rSet.Put( pCFSet->Get( nWhich ) );
+                ( SfxItemState::SET == aIter.GetItemState( true, &pItem ) ) )
+                rSet.Put( *pItem );
             nWhich = aIter.NextWhich();
         }
     }
@@ -2043,10 +2044,11 @@ static void lcl_MergeAttr_ExpandChrFormat( SfxItemSet& 
rSet, const SfxPoolItem&
             sal_uInt16 nWhich = aIter.FirstWhich();
             while( nWhich )
             {
+                const SfxPoolItem* pItem = nullptr;
                 if( ( nWhich < RES_CHRATR_END ||
                       ( RES_TXTATR_AUTOFMT == rAttr.Which() && 
RES_TXTATR_UNKNOWN_CONTAINER == nWhich ) ) &&
-                    ( SfxItemState::SET == pCFSet->GetItemState( nWhich ) ) )
-                    rSet.Put( pCFSet->Get( nWhich ) );
+                    ( SfxItemState::SET == aIter.GetItemState( true, &pItem ) 
) )
+                    rSet.Put( *pItem );
                 nWhich = aIter.NextWhich();
             }
         }
diff --git a/sw/source/filter/html/css1atr.cxx 
b/sw/source/filter/html/css1atr.cxx
index 92bb509a2020..6f3a6f3270ff 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -987,7 +987,7 @@ void SwHTMLWriter::SubtractItemSet( SfxItemSet& rItemSet,
     {
         const SfxPoolItem *pRefItem, *pItem;
         bool bItemSet = ( SfxItemState::SET ==
-                rItemSet.GetItemState( nWhich, false, &pItem) );
+                aIter.GetItemState( false, &pItem) );
         bool bRefItemSet;
 
         if( pRefScriptItemSet )
diff --git a/sw/source/filter/html/htmlatr.cxx 
b/sw/source/filter/html/htmlatr.cxx
index b9b8f32aadd3..1f1254c19bb3 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -1816,7 +1816,7 @@ void HTMLEndPosLst::Insert( const SfxItemSet& rItemSet,
     while( nWhich )
     {
         const SfxPoolItem *pItem;
-        if( SfxItemState::SET == rItemSet.GetItemState( nWhich, bDeep, &pItem 
) )
+        if( SfxItemState::SET == aIter.GetItemState( bDeep, &pItem ) )
         {
             Insert( *pItem, nStart, nEnd, rFormatInfos, bParaAttrs );
         }
diff --git a/sw/source/filter/html/htmldrawwriter.cxx 
b/sw/source/filter/html/htmldrawwriter.cxx
index 28e34c6c3cd6..6f8fce4a9de1 100644
--- a/sw/source/filter/html/htmldrawwriter.cxx
+++ b/sw/source/filter/html/htmldrawwriter.cxx
@@ -72,8 +72,7 @@ void SwHTMLWriter::GetEEAttrsFromDrwObj( SfxItemSet& rItemSet,
     while( nEEWhich )
     {
         const SfxPoolItem *pEEItem;
-        bool bSet = SfxItemState::SET == rObjItemSet.GetItemState( nEEWhich, 
false,
-                                                              &pEEItem );
+        bool bSet = SfxItemState::SET == aIter.GetItemState( false, &pEEItem );
 
         sal_uInt16 nSwWhich = 0;
         switch( nEEWhich )
diff --git a/sw/source/filter/writer/wrt_fn.cxx 
b/sw/source/filter/writer/wrt_fn.cxx
index 7935ef672671..601b61190fa9 100644
--- a/sw/source/filter/writer/wrt_fn.cxx
+++ b/sw/source/filter/writer/wrt_fn.cxx
@@ -88,7 +88,7 @@ Writer& Out_SfxItemSet( const SwAttrFnTab pTab, Writer& rWrt,
         sal_uInt16 nWhich = aIter.FirstWhich();
         while( nWhich )
         {
-            if( SfxItemState::SET == pSet->GetItemState( nWhich, bDeep, &pItem 
) &&
+            if( SfxItemState::SET == aIter.GetItemState( bDeep, &pItem ) &&
                 (   *pItem != rPool.GetDefaultItem( nWhich )
                     || ( pSet->GetParent() &&
                         *pItem != pSet->GetParent()->Get( nWhich ))
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 446d26b459de..181fbfac0508 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1377,7 +1377,7 @@ void 
lcl_writeParagraphMarkerProperties(DocxAttributeOutput& rAttributeOutput, c
     bool bFontSizeWritten = false;
     while (nWhichId)
     {
-        if (rParagraphMarkerProperties.GetItemState(nWhichId, true, &pItem) == 
SfxItemState::SET)
+        if (aIter.GetItemState(true, &pItem) == SfxItemState::SET)
         {
             if (isCHRATR(nWhichId) || nWhichId == RES_TXTATR_CHARFMT)
             {
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index f776fdc10d2f..a1193999f59c 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1246,7 +1246,7 @@ void 
MSWord_SdrAttrIter::SetItemsThatDifferFromStandard(bool bCharAttr, SfxItemS
     SfxWhichIter aWhichIter(rSet);
     for (sal_uInt16 nEEWhich = aWhichIter.FirstWhich(); nEEWhich; nEEWhich = 
aWhichIter.NextWhich())
     {
-        if (SfxItemState::SET != rSet.GetItemState(nEEWhich, false))
+        if (SfxItemState::SET != aWhichIter.GetItemState(false))
         {
             sal_uInt16 nSwWhich = 
sw::hack::TransformWhichBetweenPools(m_rExport.m_rDoc.GetAttrPool(),
                 *m_pEditPool, nEEWhich);
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index da9c73099dae..7bd841d727b5 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -447,7 +447,7 @@ void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool 
bWriteCombChars)
                     sal_uInt16 nWhichId = aIter.FirstWhich();
                     while( nWhichId )
                     {
-                        if( SfxItemState::SET == pSet->GetItemState( nWhichId, 
false, &pItem ))
+                        if( SfxItemState::SET == aIter.GetItemState( false, 
&pItem ))
                         {
                             if (nWhichId == nFontId)
                                 pFont = &(item_cast<SvxFontItem>(*pItem));
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 78bbb5219e57..c8f147e05763 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -5640,7 +5640,7 @@ void AttributeOutputBase::OutputStyleItemSet( const 
SfxItemSet& rSet, bool bTest
         sal_uInt16 nWhich = aIter.FirstWhich();
         while ( nWhich )
         {
-            if ( SfxItemState::SET == pSet->GetItemState( nWhich, 
true/*bDeep*/, &pItem ) &&
+            if ( SfxItemState::SET == aIter.GetItemState( true/*bDeep*/, 
&pItem ) &&
                  ( !bTestForDefault ||
                    nWhich == RES_UL_SPACE ||
                    nWhich == RES_LR_SPACE ||

Reply via email to