summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-10-01 00:21:00 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-10-01 06:35:49 +0200
commit981654f6e0d57c2c6dd1bbf740a6b67941146497 (patch)
treef7cf40ccf38d4666280b647c77ea7859e97f89e4 /svx
parent1fc63383ccd8af144d681ba405f5ead863ac24e1 (diff)
Drop SfxItemIter::FirstItem
It is always used right after the iterator is created, where simple GetCurItem gives the same value without reseting the position. Change-Id: I871dc7989b79e13f06436ef7928692645b5209f6 Reviewed-on: https://gerrit.libreoffice.org/79903 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/hdft.cxx9
-rw-r--r--svx/source/sdr/properties/textproperties.cxx5
-rw-r--r--svx/source/svdraw/svdedtv1.cxx10
-rw-r--r--svx/source/svdraw/svdedxv.cxx6
-rw-r--r--svx/source/svdraw/svdpntv.cxx6
5 files changed, 13 insertions, 23 deletions
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 32430371fe8e..fc11a549e3a2 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -94,13 +94,11 @@ namespace svx {
if ( pDlg->Execute() == RET_OK && pDlg->GetOutputItemSet() )
{
SfxItemIter aIter( *pDlg->GetOutputItemSet() );
- const SfxPoolItem* pItem = aIter.FirstItem();
- while ( pItem )
+ for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
{
if ( !IsInvalidItem( pItem ) )
pBBSet->Put( *pItem );
- pItem = aIter.NextItem();
}
bRes = true;
}
@@ -627,16 +625,13 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, weld::Button&, void)
if(RET_OK == pDlg->Execute() && pDlg->GetOutputItemSet())
{
SfxItemIter aIter(*pDlg->GetOutputItemSet());
- const SfxPoolItem* pItem = aIter.FirstItem();
- while(pItem)
+ for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
{
if(!IsInvalidItem(pItem))
{
pBBSet->Put(*pItem);
}
-
- pItem = aIter.NextItem();
}
{
diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx
index e6e51437d616..1ba561ef527c 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -320,9 +320,9 @@ namespace sdr
// which occur in StyleSheet, take care of
// parents (!)
SfxItemIter aIter(pNewStyleSheet->GetItemSet());
- const SfxPoolItem* pItem = aIter.FirstItem();
- while(pItem)
+ for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem;
+ pItem = aIter.NextItem())
{
if(!IsInvalidItem(pItem))
{
@@ -333,7 +333,6 @@ namespace sdr
rOutliner.RemoveCharAttribs(nPara, nW);
}
}
- pItem = aIter.NextItem();
}
}
}
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 7b2ac400e544..15d69fa3e132 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -937,8 +937,7 @@ std::vector<sal_uInt16> GetAllCharPropIds(const SfxItemSet& rSet)
std::vector<sal_uInt16> aCharWhichIds;
{
SfxItemIter aIter(rSet);
- const SfxPoolItem* pItem=aIter.FirstItem();
- while (pItem!=nullptr)
+ for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem())
{
if (!IsInvalidItem(pItem))
{
@@ -946,7 +945,6 @@ std::vector<sal_uInt16> GetAllCharPropIds(const SfxItemSet& rSet)
if (nWhich>=EE_CHAR_START && nWhich<=EE_CHAR_END)
aCharWhichIds.push_back( nWhich );
}
- pItem=aIter.NextItem();
}
}
return aCharWhichIds;
@@ -961,13 +959,13 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll)
{
bool bHasEEFeatureItems=false;
SfxItemIter aIter(rAttr);
- const SfxPoolItem* pItem=aIter.FirstItem();
- while (!bHasEEFeatureItems && pItem!=nullptr) {
+ for (const SfxPoolItem* pItem = aIter.GetCurItem(); !bHasEEFeatureItems && pItem;
+ pItem = aIter.NextItem())
+ {
if (!IsInvalidItem(pItem)) {
sal_uInt16 nW=pItem->Which();
if (nW>=EE_FEATURE_START && nW<=EE_FEATURE_END) bHasEEFeatureItems=true;
}
- pItem=aIter.NextItem();
}
if(bHasEEFeatureItems)
{
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index ab186938f46c..52b178b0a82b 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2168,8 +2168,8 @@ bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
{
bool bHasEEFeatureItems = false;
SfxItemIter aIter(rSet);
- const SfxPoolItem* pItem = aIter.FirstItem();
- while (!bHasEEFeatureItems && pItem != nullptr)
+ for (const SfxPoolItem* pItem = aIter.GetCurItem(); !bHasEEFeatureItems && pItem;
+ pItem = aIter.NextItem())
{
if (!IsInvalidItem(pItem))
{
@@ -2177,8 +2177,6 @@ bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
if (nW >= EE_FEATURE_START && nW <= EE_FEATURE_END)
bHasEEFeatureItems = true;
}
-
- pItem = aIter.NextItem();
}
if (bHasEEFeatureItems)
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 458a22f60bc2..ec2a3b1917c5 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -967,13 +967,13 @@ void SdrPaintView::SetDefaultAttr(const SfxItemSet& rAttr, bool bReplaceAll)
{
bool bHasEEFeatureItems=false;
SfxItemIter aIter(rAttr);
- const SfxPoolItem* pItem=aIter.FirstItem();
- while (!bHasEEFeatureItems && pItem!=nullptr) {
+ for (const SfxPoolItem* pItem = aIter.GetCurItem(); !bHasEEFeatureItems && pItem;
+ pItem = aIter.NextItem())
+ {
if (!IsInvalidItem(pItem)) {
sal_uInt16 nW=pItem->Which();
if (nW>=EE_FEATURE_START && nW<=EE_FEATURE_END) bHasEEFeatureItems=true;
}
- pItem=aIter.NextItem();
}
if(bHasEEFeatureItems)