[Libreoffice-commits] core.git: 2 commits - postprocess/qa pyuno/source reportdesign/source sc/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 15 18:23:35 UTC 2019


 postprocess/qa/services.cxx                           |    5 +++--
 pyuno/source/module/pyuno_struct.cxx                  |    3 ++-
 reportdesign/source/core/api/ReportDefinition.cxx     |    2 +-
 reportdesign/source/ui/inspection/GeometryHandler.cxx |    4 ++--
 reportdesign/source/ui/inspection/metadata.cxx        |    2 +-
 reportdesign/source/ui/report/ViewsWindow.cxx         |    2 +-
 sc/source/core/data/dpobject.cxx                      |    7 ++++---
 sc/source/core/tool/addincol.cxx                      |    2 +-
 sc/source/core/tool/appoptio.cxx                      |    2 +-
 sc/source/filter/excel/xepivotxml.cxx                 |    6 +++---
 sc/source/filter/oox/formulabase.cxx                  |    4 ++--
 sc/source/filter/oox/workbookhelper.cxx               |    4 ++--
 sc/source/filter/xml/XMLCodeNameProvider.cxx          |    2 +-
 sc/source/filter/xml/xmlexprt.cxx                     |    4 ++--
 sc/source/filter/xml/xmlimprt.cxx                     |    2 +-
 sc/source/ui/miscdlgs/optsolver.cxx                   |    2 +-
 sc/source/ui/unoobj/PivotTableDataProvider.cxx        |    9 +++++----
 sc/source/ui/unoobj/appluno.cxx                       |    2 +-
 sc/source/ui/unoobj/cellvaluebinding.cxx              |    2 +-
 sc/source/ui/unoobj/chartuno.cxx                      |    2 +-
 sc/source/ui/unoobj/dapiuno.cxx                       |    2 +-
 sc/source/ui/unoobj/eventuno.cxx                      |    2 +-
 sc/source/ui/unoobj/shapeuno.cxx                      |    2 +-
 sc/source/ui/vba/vbaworksheets.cxx                    |    2 +-
 sc/source/ui/view/dbfunc3.cxx                         |    2 +-
 sc/source/ui/view/tabvwshb.cxx                        |    2 +-
 26 files changed, 42 insertions(+), 38 deletions(-)

New commits:
commit 16d7e22d78cdeac149ee874f803292b3e2634e0a
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Aug 15 12:34:57 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 15 20:22:06 2019 +0200

    loplugin:sequenceloop in sc
    
    Change-Id: I84e0b4784ddc66864b29e3b1f20c926aa17fc77f
    Reviewed-on: https://gerrit.libreoffice.org/77523
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 4c7d02baa957..9cfc72391e46 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -262,10 +262,11 @@ static sheet::DataPilotFieldOrientation lcl_GetDataGetOrientation( const uno::Re
     sheet::DataPilotFieldOrientation nRet = sheet::DataPilotFieldOrientation_HIDDEN;
     if ( xSource.is() )
     {
-        uno::Reference<container::XNameAccess> xDimNames = xSource->getDimensions();
-        for (const OUString& rDimName: xDimNames->getElementNames())
+        uno::Reference<container::XNameAccess> xDimNameAccess = xSource->getDimensions();
+        const uno::Sequence<OUString> aDimNames = xDimNameAccess->getElementNames();
+        for (const OUString& rDimName : aDimNames)
         {
-            uno::Reference<beans::XPropertySet> xDimProp(xDimNames->getByName(rDimName),
+            uno::Reference<beans::XPropertySet> xDimProp(xDimNameAccess->getByName(rDimName),
                                                          uno::UNO_QUERY);
             if ( xDimProp.is() )
             {
diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx
index 9dbe56cb70fb..ceeb156a0a31 100644
--- a/sc/source/core/tool/addincol.cxx
+++ b/sc/source/core/tool/addincol.cxx
@@ -439,7 +439,7 @@ void ScUnoAddInCollection::ReadConfiguration()
                     uno::Sequence<beans::PropertyValue> aLocalEntries;
                     if ( aCompProperties[0] >>= aLocalEntries )
                     {
-                        for ( const beans::PropertyValue& rConfig : aLocalEntries )
+                        for ( const beans::PropertyValue& rConfig : std::as_const(aLocalEntries) )
                         {
                             // PropertyValue name is the locale ("convert" from
                             // string to canonicalize)
diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx
index d181a450b795..530a8d9438cb 100644
--- a/sc/source/core/tool/appoptio.cxx
+++ b/sc/source/core/tool/appoptio.cxx
@@ -176,7 +176,7 @@ static void lcl_SetSortList( const Any& rValue )
         {
             aList.clear();
 
-            for (const auto& rStr : aSeq)
+            for (const auto& rStr : std::as_const(aSeq))
             {
                 ScUserListData* pNew = new ScUserListData( rStr );
                 aList.push_back(pNew);
diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx
index eaee25d916c5..36db55476da8 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -715,16 +715,16 @@ void WriteGrabBagItemToStream(XclExpXmlStream& rStrm, sal_Int32 tokenId, const c
 
         css::uno::Sequence<css::xml::FastAttribute> aFastSeq;
         css::uno::Sequence<css::xml::Attribute> aUnkSeq;
-        for (const auto& a : aSeqs)
+        for (const auto& a : std::as_const(aSeqs))
         {
             if (a >>= aFastSeq)
             {
-                for (const auto& rAttr : aFastSeq)
+                for (const auto& rAttr : std::as_const(aFastSeq))
                     rStrm.WriteAttributes(rAttr.Token, rAttr.Value);
             }
             else if (a >>= aUnkSeq)
             {
-                for (const auto& rAttr : aUnkSeq)
+                for (const auto& rAttr : std::as_const(aUnkSeq))
                     pStrm->write(" ")
                         ->write(rAttr.Name)
                         ->write("=\"")
diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx
index f20cfb82a679..2e49ffd94447 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -1238,7 +1238,7 @@ bool OpCodeProviderImpl::fillTokenMap( ApiTokenMap& orTokenMap, OpCodeEntrySeque
     orTokenMap.clear();
     if( fillEntrySeq( orEntrySeq, rxMapper, nMapGroup ) )
     {
-        for( const FormulaOpCodeMapEntry& rEntry : orEntrySeq )
+        for( const FormulaOpCodeMapEntry& rEntry : std::as_const(orEntrySeq) )
             orTokenMap[ rEntry.Name ] = rEntry.Token;
     }
     return orEntrySeq.hasElements();
@@ -1250,7 +1250,7 @@ bool OpCodeProviderImpl::fillFuncTokenMaps( ApiTokenMap& orIntFuncTokenMap, ApiT
     orExtFuncTokenMap.clear();
     if( fillEntrySeq( orEntrySeq, rxMapper, css::sheet::FormulaMapGroup::FUNCTIONS ) )
     {
-        for( const FormulaOpCodeMapEntry& rEntry : orEntrySeq )
+        for( const FormulaOpCodeMapEntry& rEntry : std::as_const(orEntrySeq) )
             ((rEntry.Token.OpCode == OPCODE_EXTERNAL) ? orExtFuncTokenMap : orIntFuncTokenMap)[ rEntry.Name ] = rEntry.Token;
     }
     return orEntrySeq.hasElements();
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 00936636335d..5fb3dca410a1 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -733,7 +733,7 @@ void WorkbookHelper::finalizeWorkbookImport()
             {
                 OUString sTabName;
                 Reference< XNameAccess > xSheetsNC;
-                for (const auto& rProp : aSeq)
+                for (const auto& rProp : std::as_const(aSeq))
                 {
                     OUString sName(rProp.Name);
                     if (sName == SC_ACTIVETABLE)
@@ -756,7 +756,7 @@ void WorkbookHelper::finalizeWorkbookImport()
                     Any aAny = xSheetsNC->getByName(sTabName);
                     if ( aAny >>= aProperties )
                     {
-                        for (const auto& rProp : aProperties)
+                        for (const auto& rProp : std::as_const(aProperties))
                         {
                             OUString sName(rProp.Name);
                             if (sName == SC_POSITIONLEFT)
diff --git a/sc/source/filter/xml/XMLCodeNameProvider.cxx b/sc/source/filter/xml/XMLCodeNameProvider.cxx
index 4f71732450f1..85d95e415b03 100644
--- a/sc/source/filter/xml/XMLCodeNameProvider.cxx
+++ b/sc/source/filter/xml/XMLCodeNameProvider.cxx
@@ -30,7 +30,7 @@ bool XMLCodeNameProvider::_getCodeName( const uno::Any& aAny, OUString& rCodeNam
     if( !(aAny >>= aProps) )
         return false;
 
-    for( const auto& rProp : aProps )
+    for( const auto& rProp : std::as_const(aProps) )
     {
         if( rProp.Name == "CodeName" )
         {
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index eeaca6737b22..da3bfc0f13d8 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2104,7 +2104,7 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x
                 else
                     nIndex = pCellStyles->GetIndexOfStyleName(sName, XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX, bIsAutoStyle);
 
-                uno::Sequence<table::CellRangeAddress> aAddresses(xCellRanges->getRangeAddresses());
+                const uno::Sequence<table::CellRangeAddress> aAddresses(xCellRanges->getRangeAddresses());
                 bool bGetMerge(true);
                 for (table::CellRangeAddress const & address : aAddresses)
                 {
@@ -2123,7 +2123,7 @@ void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& x
             pCellStyles->AddStyleName(sEncodedStyleName, nIndex, false);
             if ( !pOldName )
             {
-                uno::Sequence<table::CellRangeAddress> aAddresses(xCellRanges->getRangeAddresses());
+                const uno::Sequence<table::CellRangeAddress> aAddresses(xCellRanges->getRangeAddresses());
                 bool bGetMerge(true);
                 for (table::CellRangeAddress const & address : aAddresses)
                 {
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 5d083893f4a0..96c348d34f35 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1717,7 +1717,7 @@ void SAL_CALL ScXMLImport::endDocument()
                     uno::Sequence< beans::PropertyValue > aSeq;
                     if (xIndexAccess->getByIndex(0) >>= aSeq)
                     {
-                        for (const auto& rProp : aSeq)
+                        for (const auto& rProp : std::as_const(aSeq))
                         {
                             OUString sName(rProp.Name);
                             if (sName == SC_ACTIVETABLE)
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 09ad93d1a666..12c26f40fc22 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -966,7 +966,7 @@ bool ScOptSolverDlg::CallSolver()       // return true -> close dialog after cal
     uno::Reference<beans::XPropertySet> xOptProp(xSolver, uno::UNO_QUERY);
     if ( xOptProp.is() )
     {
-        for (const beans::PropertyValue& rValue : maProperties)
+        for (const beans::PropertyValue& rValue : std::as_const(maProperties))
         {
             try
             {
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 )
             {
diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx
index f5ee2e265897..376de73ecc0b 100644
--- a/sc/source/ui/vba/vbaworksheets.cxx
+++ b/sc/source/ui/vba/vbaworksheets.cxx
@@ -427,7 +427,7 @@ ScVbaWorksheets::Item(const uno::Any& Index, const uno::Any& Index2)
         SheetMap aSheets;
         uno::Sequence< uno::Any > sIndices;
         aConverted >>= sIndices;
-        for( const auto& rIndex : sIndices )
+        for( const auto& rIndex : std::as_const(sIndices) )
         {
             uno::Reference< excel::XWorksheet > xWorkSheet( ScVbaWorksheets_BASE::Item( rIndex, Index2 ), uno::UNO_QUERY_THROW );
             ScVbaWorksheet* pWorkSheet = excel::getImplFromDocModuleWrapper<ScVbaWorksheet>( xWorkSheet );
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index e2add0b814b0..751313c201eb 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1805,7 +1805,7 @@ bool ScDBFunc::DataPilotMove( const ScRange& rSource, const ScAddress& rDest )
 
                 bool bInserted = false;
 
-                for (const OUString& aMemberStr : aMemberNames)
+                for (const OUString& aMemberStr : std::as_const(aMemberNames))
                 {
                     if ( !bInserted && aMemberStr == aDestData.MemberName )
                     {
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index 14e011e9d331..76c330dadc50 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -114,7 +114,7 @@ public:
             sal_Int32 dimensionIndex = 0;
             OUString sPivotTableName("DataPilot1");
 
-            for (beans::PropertyValue const & rProperty : aProperties)
+            for (beans::PropertyValue const & rProperty : std::as_const(aProperties))
             {
                 if (rProperty.Name == "Rectangle")
                     rProperty.Value >>= xRectangle;
commit aea932b58bbb2346fb5c1bc02bcfed3e43dedabc
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Aug 15 12:34:46 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 15 20:21:55 2019 +0200

    loplugin:sequenceloop in postprocess..reportdesign
    
    Change-Id: I86b9174c37e4a347a3a8ac6c2707052167e6fdc0
    Reviewed-on: https://gerrit.libreoffice.org/77522
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/postprocess/qa/services.cxx b/postprocess/qa/services.cxx
index 321432871ddf..a807a037e80e 100644
--- a/postprocess/qa/services.cxx
+++ b/postprocess/qa/services.cxx
@@ -106,7 +106,8 @@ void addService(
     if (!allServices->insert(service).second) {
         return;
     }
-    for (auto const & serv: service->getMandatoryServices()) {
+    const auto aMandatoryServices = service->getMandatoryServices();
+    for (auto const & serv : aMandatoryServices) {
         addService(serv, allServices);
     }
 }
@@ -400,7 +401,7 @@ void Test::createInstance(
             + msg(name) + "\" reports wrong implementation name")
          .getStr()),
         expImpl, info->getImplementationName());
-    css::uno::Sequence<OUString> servs(info->getSupportedServiceNames());
+    const css::uno::Sequence<OUString> servs(info->getSupportedServiceNames());
     CPPUNIT_ASSERT_MESSAGE(
         (OString(
             "instantiating \"" + msg(implementationName) + "\" via \""
diff --git a/pyuno/source/module/pyuno_struct.cxx b/pyuno/source/module/pyuno_struct.cxx
index 9ad9439318ce..64dc11499f6b 100644
--- a/pyuno/source/module/pyuno_struct.cxx
+++ b/pyuno/source/module/pyuno_struct.cxx
@@ -105,7 +105,8 @@ static PyObject* PyUNOStruct_dir( PyObject *self )
     try
     {
         member_list = PyList_New( 0 );
-        for( const auto& aMember : me->members->xInvocation->getMemberNames() )
+        const css::uno::Sequence<OUString> aMemberNames = me->members->xInvocation->getMemberNames();
+        for( const auto& aMember : aMemberNames )
         {
             // setitem steals a reference
             PyList_Append( member_list, ustring2PyString( aMember ).getAcquired() );
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index dcb0fb6eb1d4..1396c93ebb2e 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -2475,7 +2475,7 @@ OUString OReportDefinition::getDocumentBaseURL() const
 
     ::osl::MutexGuard aGuard(m_aMutex);
     ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
-    for (beans::PropertyValue const& it : m_pImpl->m_aArgs)
+    for (beans::PropertyValue const& it : std::as_const(m_pImpl->m_aArgs))
     {
         if (it.Name == "DocumentBaseURL")
             return it.Value.get<OUString>();
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index f6135f5307f2..37631941ce21 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -803,11 +803,11 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const
                 }
                 else
                 {
-                    for (auto const& it : m_aFieldNames)
+                    for (auto const& it : std::as_const(m_aFieldNames))
                     {
                         xListControl->appendListEntry(it);
                     }
-                    for (auto const& it : m_aParamNames)
+                    for (auto const& it : std::as_const(m_aParamNames))
                     {
                         xListControl->appendListEntry(it);
                     }
diff --git a/reportdesign/source/ui/inspection/metadata.cxx b/reportdesign/source/ui/inspection/metadata.cxx
index db8ac3eb494f..14e4a3088871 100644
--- a/reportdesign/source/ui/inspection/metadata.cxx
+++ b/reportdesign/source/ui/inspection/metadata.cxx
@@ -226,7 +226,7 @@ namespace rptui
 
     void OPropertyInfoService::getExcludeProperties(::std::vector< beans::Property >& _rExcludeProperties,const css::uno::Reference< css::inspection::XPropertyHandler >& _xFormComponentHandler)
     {
-        uno::Sequence< beans::Property > aProps = _xFormComponentHandler->getSupportedProperties();
+        const uno::Sequence< beans::Property > aProps = _xFormComponentHandler->getSupportedProperties();
         static const OUStringLiteral pExcludeProperties[] =
         {
                 "Enabled",
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 47afcfe630fe..f81db3a9a4bf 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -1227,7 +1227,7 @@ void OViewsWindow::EndDragObj(bool _bControlKeyPressed, const OSectionView* _pSe
                     aNewPos.setY( 0 );
 
                 Point aPrevious;
-                for (beans::NamedValue const & namedVal : aAllreadyCopiedObjects)
+                for (beans::NamedValue const & namedVal : std::as_const(aAllreadyCopiedObjects))
                 {
                     uno::Sequence< uno::Reference<report::XReportComponent> > aClones;
                     namedVal.Value >>= aClones;


More information about the Libreoffice-commits mailing list