diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-15 12:34:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-15 20:22:06 +0200 |
commit | 16d7e22d78cdeac149ee874f803292b3e2634e0a (patch) | |
tree | 8e7d06758af8a478833d840d7e144ef6c7322e74 /sc/source/ui/unoobj | |
parent | aea932b58bbb2346fb5c1bc02bcfed3e43dedabc (diff) |
loplugin:sequenceloop in sc
Change-Id: I84e0b4784ddc66864b29e3b1f20c926aa17fc77f
Reviewed-on: https://gerrit.libreoffice.org/77523
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r-- | sc/source/ui/unoobj/PivotTableDataProvider.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/unoobj/appluno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellvaluebinding.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/chartuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/dapiuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/eventuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/shapeuno.cxx | 2 |
7 files changed, 11 insertions, 10 deletions
diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx b/sc/source/ui/unoobj/PivotTableDataProvider.cxx index b3d05f7e907b..633f1b1786b3 100644 --- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx +++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx @@ -107,7 +107,8 @@ std::vector<OUString> lcl_getVisiblePageMembers(const uno::Reference<uno::XInter if (!xMembersAccess.is()) return aResult; - for (OUString const & rMemberNames : xMembersAccess->getElementNames()) + const css::uno::Sequence<OUString> aMembersNames = xMembersAccess->getElementNames(); + for (OUString const & rMemberNames : aMembersNames) { uno::Reference<beans::XPropertySet> xProperties(xMembersAccess->getByName(rMemberNames), uno::UNO_QUERY); if (!xProperties.is()) @@ -284,7 +285,7 @@ void PivotTableDataProvider::collectPivotTableData() m_aFieldOutputDescriptionMap.clear(); uno::Reference<sheet::XDataPilotResults> xDPResults(pDPObject->GetSource(), uno::UNO_QUERY); - uno::Sequence<uno::Sequence<sheet::DataResult>> xDataResultsSequence = xDPResults->getResults(); + const uno::Sequence<uno::Sequence<sheet::DataResult>> xDataResultsSequence = xDPResults->getResults(); double fNan; rtl::math::setNan(&fNan); @@ -385,7 +386,7 @@ void PivotTableDataProvider::collectPivotTableData() { m_aColumnFields.emplace_back(xLevelName->getName(), nDim, nDimPos, bHasHiddenMember); - uno::Sequence<sheet::MemberResult> aSequence = xLevelResult->getResults(); + const uno::Sequence<sheet::MemberResult> aSequence = xLevelResult->getResults(); size_t i = 0; OUString sCaption; OUString sName; @@ -429,7 +430,7 @@ void PivotTableDataProvider::collectPivotTableData() { m_aRowFields.emplace_back(xLevelName->getName(), nDim, nDimPos, bHasHiddenMember); - uno::Sequence<sheet::MemberResult> aSequence = xLevelResult->getResults(); + const uno::Sequence<sheet::MemberResult> aSequence = xLevelResult->getResults(); size_t i = 0; size_t nEachIndex = 0; diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx index e256ec67ba26..a2c9c2c9e227 100644 --- a/sc/source/ui/unoobj/appluno.cxx +++ b/sc/source/ui/unoobj/appluno.cxx @@ -349,7 +349,7 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue( // ScGlobal::SetUseTabCol does not do much else pUserList->clear(); - for (const OUString& aEntry : aSeq) + for (const OUString& aEntry : std::as_const(aSeq)) { ScUserListData* pData = new ScUserListData(aEntry); pUserList->push_back(pData); diff --git a/sc/source/ui/unoobj/cellvaluebinding.cxx b/sc/source/ui/unoobj/cellvaluebinding.cxx index 63012c3b9aef..de7f0fde4f71 100644 --- a/sc/source/ui/unoobj/cellvaluebinding.cxx +++ b/sc/source/ui/unoobj/cellvaluebinding.cxx @@ -164,7 +164,7 @@ namespace calc checkInitialized( ); // look up in our sequence - Sequence< Type > aSupportedTypes( getSupportedValueTypes() ); + const Sequence< Type > aSupportedTypes( getSupportedValueTypes() ); for ( auto const & i : aSupportedTypes ) if ( aType == i ) return true; diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx index 01bff2042eb8..f158fd0c7686 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -522,7 +522,7 @@ void ScChartObj::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno: if ( rValue >>= aCellRanges ) { ScRangeListRef rRangeList = new ScRangeList(); - for ( table::CellRangeAddress const & aCellRange : aCellRanges ) + for ( table::CellRangeAddress const & aCellRange : std::as_const(aCellRanges) ) { ScRange aRange; ScUnoConversion::FillScRange( aRange, aCellRange ); diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index 3a3f51600f06..26809c5190ae 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -836,7 +836,7 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp aServiceDesc = *pOldDesc; OUString aStrVal; - for (const beans::PropertyValue& rProp : aArgSeq) + for (const beans::PropertyValue& rProp : std::as_const(aArgSeq)) { OUString aPropName(rProp.Name); diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx index 6e4eccb52d84..3aab2004dd66 100644 --- a/sc/source/ui/unoobj/eventuno.cxx +++ b/sc/source/ui/unoobj/eventuno.cxx @@ -85,7 +85,7 @@ void SAL_CALL ScSheetEventsObj::replaceByName( const OUString& aName, const uno: uno::Sequence<beans::PropertyValue> aPropSeq; if ( aElement >>= aPropSeq ) { - for (const beans::PropertyValue& rProp : aPropSeq) + for (const beans::PropertyValue& rProp : std::as_const(aPropSeq)) { if ( rProp.Name == SC_UNO_EVENTTYPE ) { diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index 85ab26b65d98..946d1ce6bcd9 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -1342,7 +1342,7 @@ public: uno::Sequence< beans::PropertyValue > aProperties; aElement >>= aProperties; bool isEventType = false; - for( const beans::PropertyValue& rProperty : aProperties ) + for( const beans::PropertyValue& rProperty : std::as_const(aProperties) ) { if ( rProperty.Name == SC_EVENTACC_EVENTTYPE ) { |