summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-06 10:14:38 +0200
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2016-05-07 12:24:31 +0000
commit9613b493172fe9aa8efd9c9c090f82ca2e89cf21 (patch)
tree3cc0d212aea1de270160e295a70c9f08f2e84334 /sc/source/ui/unoobj
parent464348e82d8cbb0a6d3e5638da3f737f3e6f2d00 (diff)
clang-tidy modernize-loop-convert in sc
Change-Id: I620028d69b11ea0469efd7b02ac7bbc7edab1066 Reviewed-on: https://gerrit.libreoffice.org/24690 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx14
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx4
-rw-r--r--sc/source/ui/unoobj/condformatuno.cxx102
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx4
-rw-r--r--sc/source/ui/unoobj/datauno.cxx8
-rw-r--r--sc/source/ui/unoobj/dispuno.cxx8
-rw-r--r--sc/source/ui/unoobj/docuno.cxx6
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx12
-rw-r--r--sc/source/ui/unoobj/servuno.cxx14
-rw-r--r--sc/source/ui/unoobj/targuno.cxx4
10 files changed, 88 insertions, 88 deletions
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 4a3c984a0499..1247ab21aa2c 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1611,8 +1611,8 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
lang::EventObject aEvent;
aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
- for ( size_t n=0; n<aValueListeners.size(); n++ )
- aValueListeners[n]->disposing( aEvent );
+ for (uno::Reference<util::XModifyListener> & xValueListener : aValueListeners)
+ xValueListener->disposing( aEvent );
aValueListeners.clear();
@@ -1641,8 +1641,8 @@ void ScCellRangesBase::Notify( SfxBroadcaster&, const SfxHint& rHint )
// the EventObject holds a Ref to this object until after the listener calls
ScDocument& rDoc = pDocShell->GetDocument();
- for ( size_t n=0; n<aValueListeners.size(); n++ )
- rDoc.AddUnoListenerCall( aValueListeners[n], aEvent );
+ for (uno::Reference<util::XModifyListener> & xValueListener : aValueListeners)
+ rDoc.AddUnoListenerCall( xValueListener, aEvent );
bGotDataChangedHint = false;
}
@@ -4525,12 +4525,12 @@ static bool lcl_FindRangeOrEntry( const ScNamedEntryArr_Impl& rNamedEntries,
if ( !rNamedEntries.empty() )
{
- for ( size_t n=0; n<rNamedEntries.size(); n++ )
- if ( rNamedEntries[n].GetName() == rName )
+ for (const auto & rNamedEntry : rNamedEntries)
+ if ( rNamedEntry.GetName() == rName )
{
// test if named entry is contained in rRanges
- const ScRange& rComp = rNamedEntries[n].GetRange();
+ const ScRange& rComp = rNamedEntry.GetRange();
ScMarkData aMarkData;
aMarkData.MarkFromRangeList( rRanges, false );
aMarkData.MarkToMulti(); // needed for IsAllMarked
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 529fda20587b..afe109d3159f 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -2834,8 +2834,8 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
if( m_pDocument )
{
- for ( size_t n=0; n<m_aValueListeners.size(); n++ )
- m_pDocument->AddUnoListenerCall( m_aValueListeners[n], aEvent );
+ for (uno::Reference<util::XModifyListener> & xListener: m_aValueListeners)
+ m_pDocument->AddUnoListenerCall( xListener, aEvent );
}
m_bGotDataChangedHint = false;
diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx
index 5fce4c2f2489..b598649c2278 100644
--- a/sc/source/ui/unoobj/condformatuno.cxx
+++ b/sc/source/ui/unoobj/condformatuno.cxx
@@ -767,11 +767,11 @@ void SAL_CALL ScConditionEntryObj::setPropertyValue(
sal_Int32 nVal;
if (aValue >>= nVal)
{
- for (size_t i = 0; i < SAL_N_ELEMENTS(aConditionEntryMap); ++i)
+ for (ConditionEntryApiMap & rEntry : aConditionEntryMap)
{
- if (aConditionEntryMap[i].nApiMode == nVal)
+ if (rEntry.nApiMode == nVal)
{
- getCoreObject()->SetOperation(aConditionEntryMap[i].eMode);
+ getCoreObject()->SetOperation(rEntry.eMode);
break;
}
}
@@ -817,11 +817,11 @@ uno::Any SAL_CALL ScConditionEntryObj::getPropertyValue( const OUString& aProper
case Operator:
{
ScConditionMode eMode = getCoreObject()->GetOperation();
- for (size_t i = 0; i < SAL_N_ELEMENTS(aConditionEntryMap); ++i)
+ for (ConditionEntryApiMap & rEntry : aConditionEntryMap)
{
- if (aConditionEntryMap[i].eMode == eMode)
+ if (rEntry.eMode == eMode)
{
- aAny <<= aConditionEntryMap[i].nApiMode;
+ aAny <<= rEntry.nApiMode;
break;
}
}
@@ -907,11 +907,11 @@ void setColorScaleEntry(ScColorScaleEntry* pEntry, uno::Reference<sheet::XColorS
ScColorScaleEntryType eType = ScColorScaleEntryType();
sal_Int32 nApiType = xEntry->getType();
bool bFound = false;
- for (size_t i = 0; i < SAL_N_ELEMENTS(aColorScaleEntryTypeMap); ++i)
+ for (ColorScaleEntryTypeApiMap & rEntry : aColorScaleEntryTypeMap)
{
- if (aColorScaleEntryTypeMap[i].nApiType == nApiType)
+ if (rEntry.nApiType == nApiType)
{
- eType = aColorScaleEntryTypeMap[i].eType;
+ eType = rEntry.eType;
bFound = true;
break;
}
@@ -1078,11 +1078,11 @@ sal_Int32 ScColorScaleEntryObj::getType()
throw(uno::RuntimeException, std::exception)
{
ScColorScaleEntry* pEntry = getCoreObject();
- for (size_t i = 0; i < SAL_N_ELEMENTS(aColorScaleEntryTypeMap); ++i)
+ for (ColorScaleEntryTypeApiMap & rEntry : aColorScaleEntryTypeMap)
{
- if (aColorScaleEntryTypeMap[i].eType == pEntry->GetType())
+ if (rEntry.eType == pEntry->GetType())
{
- return aColorScaleEntryTypeMap[i].nApiType;
+ return rEntry.nApiType;
}
}
@@ -1093,11 +1093,11 @@ void ScColorScaleEntryObj::setType(sal_Int32 nType)
throw(uno::RuntimeException, std::exception)
{
ScColorScaleEntry* pEntry = getCoreObject();
- for (size_t i = 0; i < SAL_N_ELEMENTS(aColorScaleEntryTypeMap); ++i)
+ for (ColorScaleEntryTypeApiMap & rEntry : aColorScaleEntryTypeMap)
{
- if (aColorScaleEntryTypeMap[i].nApiType == nType)
+ if (rEntry.nApiType == nType)
{
- pEntry->SetType(aColorScaleEntryTypeMap[i].eType);
+ pEntry->SetType(rEntry.eType);
return;
}
}
@@ -1180,11 +1180,11 @@ void setDataBarEntry(ScColorScaleEntry* pEntry, uno::Reference<sheet::XDataBarEn
ScColorScaleEntryType eType = ScColorScaleEntryType();
sal_Int32 nApiType = xEntry->getType();
bool bFound = false;
- for (size_t i = 0; i < SAL_N_ELEMENTS(aDataBarEntryTypeMap); ++i)
+ for (DataBarEntryTypeApiMap & rEntry : aDataBarEntryTypeMap)
{
- if (aDataBarEntryTypeMap[i].nApiType == nApiType)
+ if (rEntry.nApiType == nApiType)
{
- eType = aDataBarEntryTypeMap[i].eType;
+ eType = rEntry.eType;
bFound = true;
break;
}
@@ -1230,12 +1230,12 @@ void SAL_CALL ScDataBarFormatObj::setPropertyValue(
sal_Int32 nVal;
if (aValue >>= nVal)
{
- for (size_t i = 0; i < SAL_N_ELEMENTS(aDataBarAxisMap); ++i)
+ for (DataBarAxisApiMap & rEntry : aDataBarAxisMap)
{
- if (aDataBarAxisMap[i].nApiPos == nVal)
+ if (rEntry.nApiPos == nVal)
{
getCoreObject()->GetDataBarData()->meAxisPosition =
- aDataBarAxisMap[i].ePos;
+ rEntry.ePos;
break;
}
}
@@ -1360,11 +1360,11 @@ uno::Any SAL_CALL ScDataBarFormatObj::getPropertyValue( const OUString& aPropert
{
databar::ScAxisPosition ePos = getCoreObject()->GetDataBarData()->meAxisPosition;
sal_Int32 nApiPos = sheet::DataBarAxis::AXIS_NONE;
- for (size_t i = 0; i < SAL_N_ELEMENTS(aDataBarAxisMap); ++i)
+ for (DataBarAxisApiMap & rEntry : aDataBarAxisMap)
{
- if (aDataBarAxisMap[i].ePos == ePos)
+ if (rEntry.ePos == ePos)
{
- nApiPos = aDataBarAxisMap[i].nApiPos;
+ nApiPos = rEntry.nApiPos;
}
}
@@ -1478,11 +1478,11 @@ sal_Int32 ScDataBarEntryObj::getType()
throw(uno::RuntimeException, std::exception)
{
ScColorScaleEntry* pEntry = getCoreObject();
- for (size_t i = 0; i < SAL_N_ELEMENTS(aDataBarEntryTypeMap); ++i)
+ for (DataBarEntryTypeApiMap & rEntry : aDataBarEntryTypeMap)
{
- if (aDataBarEntryTypeMap[i].eType == pEntry->GetType())
+ if (rEntry.eType == pEntry->GetType())
{
- return aDataBarEntryTypeMap[i].nApiType;
+ return rEntry.nApiType;
}
}
@@ -1493,11 +1493,11 @@ void ScDataBarEntryObj::setType(sal_Int32 nType)
throw(uno::RuntimeException, std::exception)
{
ScColorScaleEntry* pEntry = getCoreObject();
- for (size_t i = 0; i < SAL_N_ELEMENTS(aDataBarEntryTypeMap); ++i)
+ for (DataBarEntryTypeApiMap & rEntry : aDataBarEntryTypeMap)
{
- if (aDataBarEntryTypeMap[i].nApiType == nType)
+ if (rEntry.nApiType == nType)
{
- pEntry->SetType(aDataBarEntryTypeMap[i].eType);
+ pEntry->SetType(rEntry.eType);
return;
}
}
@@ -1581,11 +1581,11 @@ void setIconSetEntry(ScIconSetFormat* pFormat, uno::Reference<sheet::XIconSetEnt
ScColorScaleEntryType eType = ScColorScaleEntryType();
sal_Int32 nApiType = xEntry->getType();
bool bFound = false;
- for (size_t i = 0; i < SAL_N_ELEMENTS(aIconSetEntryTypeMap); ++i)
+ for (IconSetEntryTypeApiMap & rEntry : aIconSetEntryTypeMap)
{
- if (aIconSetEntryTypeMap[i].nApiType == nApiType)
+ if (rEntry.nApiType == nApiType)
{
- eType = aIconSetEntryTypeMap[i].eType;
+ eType = rEntry.eType;
bFound = true;
break;
}
@@ -1646,11 +1646,11 @@ void SAL_CALL ScIconSetFormatObj::setPropertyValue(
aValue >>= nApiType;
ScIconSetType eType = IconSet_3Arrows;
bool bFound = false;
- for (size_t i = 0; i < SAL_N_ELEMENTS(aIconSetApiMap); ++i)
+ for (const IconSetTypeApiMap & rEntry : aIconSetApiMap)
{
- if (aIconSetApiMap[i].nApiType == nApiType)
+ if (rEntry.nApiType == nApiType)
{
- eType = aIconSetApiMap[i].eType;
+ eType = rEntry.eType;
bFound = true;
break;
}
@@ -1711,11 +1711,11 @@ uno::Any SAL_CALL ScIconSetFormatObj::getPropertyValue( const OUString& aPropert
case Icons:
{
ScIconSetType eType = getCoreObject()->GetIconSetData()->eIconSetType;
- for (size_t i = 0; i < SAL_N_ELEMENTS(aIconSetApiMap); ++i)
+ for (const IconSetTypeApiMap & rEntry : aIconSetApiMap)
{
- if (aIconSetApiMap[i].eType == eType)
+ if (rEntry.eType == eType)
{
- aAny <<= aIconSetApiMap[i].nApiType;
+ aAny <<= rEntry.nApiType;
break;
}
}
@@ -1798,11 +1798,11 @@ sal_Int32 ScIconSetEntryObj::getType()
if (mnPos == 0)
return sheet::IconSetFormatEntry::ICONSET_MIN;
- for (size_t i = 0; i < SAL_N_ELEMENTS(aIconSetEntryTypeMap); ++i)
+ for (IconSetEntryTypeApiMap & rEntry : aIconSetEntryTypeMap)
{
- if (aIconSetEntryTypeMap[i].eType == pEntry->GetType())
+ if (rEntry.eType == pEntry->GetType())
{
- return aIconSetEntryTypeMap[i].nApiType;
+ return rEntry.nApiType;
}
}
@@ -1817,11 +1817,11 @@ void ScIconSetEntryObj::setType(sal_Int32 nType)
return;
ScColorScaleEntry* pEntry = getCoreObject();
- for (size_t i = 0; i < SAL_N_ELEMENTS(aIconSetEntryTypeMap); ++i)
+ for (IconSetEntryTypeApiMap & rEntry : aIconSetEntryTypeMap)
{
- if (aIconSetEntryTypeMap[i].nApiType == nType)
+ if (rEntry.nApiType == nType)
{
- pEntry->SetType(aIconSetEntryTypeMap[i].eType);
+ pEntry->SetType(rEntry.eType);
return;
}
}
@@ -1928,11 +1928,11 @@ void SAL_CALL ScCondDateFormatObj::setPropertyValue(
if (!(aValue >>= nApiType))
throw lang::IllegalArgumentException();
- for (size_t i = 0; i < SAL_N_ELEMENTS(aDateTypeApiMap); ++i)
+ for (DateTypeApiMap & rEntry : aDateTypeApiMap)
{
- if (aDateTypeApiMap[i].nApiType == nApiType)
+ if (rEntry.nApiType == nApiType)
{
- getCoreObject()->SetDateType(aDateTypeApiMap[i].eType);
+ getCoreObject()->SetDateType(rEntry.eType);
break;
}
}
@@ -1967,11 +1967,11 @@ uno::Any SAL_CALL ScCondDateFormatObj::getPropertyValue( const OUString& aProper
case DateType:
{
condformat::ScCondFormatDateType eType = getCoreObject()->GetDateType();
- for (size_t i = 0; i < SAL_N_ELEMENTS(aDateTypeApiMap); ++i)
+ for (DateTypeApiMap & rEntry : aDateTypeApiMap)
{
- if (aDateTypeApiMap[i].eType == eType)
+ if (rEntry.eType == eType)
{
- aAny <<= aDateTypeApiMap[i].nApiType;
+ aAny <<= rEntry.nApiType;
break;
}
}
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index f19bb887853e..646ddace83fb 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -1369,8 +1369,8 @@ void ScDataPilotTableObj::Refreshed_Impl()
// the EventObject holds a Ref to this object until after the listener calls
ScDocument& rDoc = GetDocShell()->GetDocument();
- for ( size_t n=0; n<aModifyListeners.size(); n++ )
- rDoc.AddUnoListenerCall( aModifyListeners[n], aEvent );
+ for (uno::Reference<util::XModifyListener> & xModifyListener : aModifyListeners)
+ rDoc.AddUnoListenerCall( xModifyListener, aEvent );
}
ScDataPilotDescriptor::ScDataPilotDescriptor(ScDocShell* pDocSh) :
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index ed79338a329b..2772aa2cb536 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -557,8 +557,8 @@ void SAL_CALL ScSubTotalDescriptorBase::clear() throw(uno::RuntimeException, std
ScSubTotalParam aParam;
GetData(aParam);
- for (sal_uInt16 i=0; i<MAXSUBTOTAL; i++)
- aParam.bGroupActive[i] = false;
+ for (bool & rn : aParam.bGroupActive)
+ rn = false;
//! Notify oder so fuer die Field-Objekte???
@@ -1953,8 +1953,8 @@ void ScDatabaseRangeObj::Refreshed_Impl()
{
lang::EventObject aEvent;
aEvent.Source = static_cast<cppu::OWeakObject*>(this);
- for ( size_t n=0; n<aRefreshListeners.size(); n++ )
- aRefreshListeners[n]->refreshed( aEvent );
+ for (uno::Reference<util::XRefreshListener> & xRefreshListener : aRefreshListeners)
+ xRefreshListener->refreshed( aEvent );
}
// XCellRangeSource
diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx
index 278507820d10..a28503943575 100644
--- a/sc/source/ui/unoobj/dispuno.cxx
+++ b/sc/source/ui/unoobj/dispuno.cxx
@@ -358,8 +358,8 @@ void SAL_CALL ScDispatch::selectionChanged( const css::lang::EventObject& /* aEv
lcl_FillDataSource( aEvent, aNewImport ); // modifies State, IsEnabled
- for ( size_t n=0; n<aDataSourceListeners.size(); n++ )
- aDataSourceListeners[n]->statusChanged( aEvent );
+ for (uno::Reference<frame::XStatusListener> & xDataSourceListener : aDataSourceListeners)
+ xDataSourceListener->statusChanged( aEvent );
aLastImport = aNewImport;
}
@@ -377,8 +377,8 @@ void SAL_CALL ScDispatch::disposing( const css::lang::EventObject& rSource )
lang::EventObject aEvent;
aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
- for ( size_t n=0; n<aDataSourceListeners.size(); n++ )
- aDataSourceListeners[n]->disposing( aEvent );
+ for (uno::Reference<frame::XStatusListener> & xDataSourceListener : aDataSourceListeners)
+ xDataSourceListener->disposing( aEvent );
pViewShell = nullptr;
}
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index bf5292ccc523..fbe2a19052bd 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -328,10 +328,10 @@ void ScPrintUIOptions::SetDefaults()
sal_Int32 nContent = rPrintOpt.GetAllSheets() ? 0 : 1;
bool bSuppress = rPrintOpt.GetSkipEmpty();
- for (size_t nUIPos=0; nUIPos<m_aUIProperties.size(); ++nUIPos)
+ for (beans::PropertyValue & rPropValue : m_aUIProperties)
{
uno::Sequence<beans::PropertyValue> aUIProp;
- if ( m_aUIProperties[nUIPos].Value >>= aUIProp )
+ if ( rPropValue.Value >>= aUIProp )
{
for (sal_Int32 nPropPos=0; nPropPos<aUIProp.getLength(); ++nPropPos)
{
@@ -354,7 +354,7 @@ void ScPrintUIOptions::SetDefaults()
}
}
}
- m_aUIProperties[nUIPos].Value <<= aUIProp;
+ rPropValue.Value <<= aUIProp;
}
}
}
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index abe81aa75f36..85e19f468784 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -185,8 +185,8 @@ void ScSheetLinkObj::Refreshed_Impl()
{
lang::EventObject aEvent;
aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
- for ( size_t n=0; n<aRefreshListeners.size(); n++ )
- aRefreshListeners[n]->refreshed( aEvent );
+ for (uno::Reference<util::XRefreshListener> & xRefreshListener : aRefreshListeners)
+ xRefreshListener->refreshed( aEvent );
}
void ScSheetLinkObj::ModifyRefreshDelay_Impl( sal_Int32 nRefresh )
@@ -728,8 +728,8 @@ void ScAreaLinkObj::Refreshed_Impl()
{
lang::EventObject aEvent;
aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
- for ( size_t n=0; n<aRefreshListeners.size(); n++ )
- aRefreshListeners[n]->refreshed( aEvent );
+ for (uno::Reference<util::XRefreshListener> & xRefreshListener : aRefreshListeners)
+ xRefreshListener->refreshed( aEvent );
}
// XPropertySet
@@ -1219,8 +1219,8 @@ void ScDDELinkObj::Refreshed_Impl()
{
lang::EventObject aEvent;
aEvent.Source.set(static_cast<cppu::OWeakObject*>(this));
- for ( size_t n=0; n<aRefreshListeners.size(); n++ )
- aRefreshListeners[n]->refreshed( aEvent );
+ for (uno::Reference<util::XRefreshListener> & xRefreshListener : aRefreshListeners)
+ xRefreshListener->refreshed( aEvent );
}
ScDDELinksObj::ScDDELinksObj(ScDocShell* pDocSh) :
diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx
index 6d9a1db57f9c..0d242d73df34 100644
--- a/sc/source/ui/unoobj/servuno.cxx
+++ b/sc/source/ui/unoobj/servuno.cxx
@@ -366,21 +366,21 @@ ScServiceProvider::Type ScServiceProvider::GetProviderType(const OUString& rServ
{
if (!rServiceName.isEmpty())
{
- for (sal_uInt16 i = 0; i < SAL_N_ELEMENTS(aProvNamesId); i++)
+ for (const ProvNamesId_Type & i : aProvNamesId)
{
- if (rServiceName.equalsAscii( aProvNamesId[i].pName ))
+ if (rServiceName.equalsAscii( i.pName ))
{
- return aProvNamesId[i].nType;
+ return i.nType;
}
}
- for (sal_uInt16 i=0; i < SAL_N_ELEMENTS(aOldNames); i++)
+ for (const ProvNamesId_Type & rOldName : aOldNames)
{
- OSL_ENSURE( aOldNames[i].pName, "ScServiceProvider::GetProviderType: no oldname => crash");
- if (rServiceName.equalsAscii( aOldNames[i].pName ))
+ OSL_ENSURE( rOldName.pName, "ScServiceProvider::GetProviderType: no oldname => crash");
+ if (rServiceName.equalsAscii( rOldName.pName ))
{
OSL_FAIL("old service name used");
- return aOldNames[i].nType;
+ return rOldName.nType;
}
}
}
diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx
index 8512c8603e8b..5d714f688521 100644
--- a/sc/source/ui/unoobj/targuno.cxx
+++ b/sc/source/ui/unoobj/targuno.cxx
@@ -114,8 +114,8 @@ uno::Sequence<OUString> SAL_CALL ScLinkTargetTypesObj::getElementNames() throw(
sal_Bool SAL_CALL ScLinkTargetTypesObj::hasByName(const OUString& aName) throw( uno::RuntimeException, std::exception )
{
- for (sal_uInt16 i=0; i<SC_LINKTARGETTYPE_COUNT; i++)
- if ( aNames[i] == aName )
+ for (const auto & i : aNames)
+ if ( i == aName )
return true;
return false;
}