summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-01-27 15:42:54 +0600
committerMike Kaganski <mike.kaganski@collabora.com>2024-01-27 12:43:48 +0100
commit0fa827dbb2147d1d3850b2181eb6ab6a02a04500 (patch)
tree721d02c64c26365e605a2348fd1ff744c4dd8d29 /sc
parentdb227dc7d032d642983c313ab74c34a301464c2a (diff)
Drop std::as_const from css::uno::Sequence iterations
Obsoleted by commit 2484de6728bd11bb7949003d112f1ece2223c7a1 (Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and commit fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[] in internal code, 2021-11-05). Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/subsequent_filters_test3.cxx4
-rw-r--r--sc/source/core/data/dpobject.cxx2
-rw-r--r--sc/source/core/tool/addincol.cxx4
-rw-r--r--sc/source/core/tool/appoptio.cxx2
-rw-r--r--sc/source/filter/excel/excel.cxx2
-rw-r--r--sc/source/filter/excel/xechart.cxx2
-rw-r--r--sc/source/filter/excel/xepivotxml.cxx6
-rw-r--r--sc/source/filter/oox/formulabase.cxx4
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx4
-rw-r--r--sc/source/filter/xml/XMLCodeNameProvider.cxx2
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx2
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx6
-rw-r--r--sc/source/ui/unoobj/appluno.cxx2
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx2
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx2
-rw-r--r--sc/source/ui/unoobj/dapiuno.cxx2
-rw-r--r--sc/source/ui/unoobj/eventuno.cxx2
-rw-r--r--sc/source/ui/unoobj/funcuno.cxx2
-rw-r--r--sc/source/ui/unoobj/shapeuno.cxx2
-rw-r--r--sc/source/ui/vba/vbaworksheets.cxx2
-rw-r--r--sc/source/ui/view/dbfunc3.cxx2
-rw-r--r--sc/source/ui/view/tabvwshb.cxx2
22 files changed, 30 insertions, 30 deletions
diff --git a/sc/qa/unit/subsequent_filters_test3.cxx b/sc/qa/unit/subsequent_filters_test3.cxx
index cdde83913715..b30a9b40eccf 100644
--- a/sc/qa/unit/subsequent_filters_test3.cxx
+++ b/sc/qa/unit/subsequent_filters_test3.cxx
@@ -784,7 +784,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTextBoxBodyUpright)
{
uno::Sequence<beans::PropertyValue> aGrabBag;
xShapeProperties->getPropertyValue("InteropGrabBag") >>= aGrabBag;
- for (auto& aProp : std::as_const(aGrabBag))
+ for (auto& aProp : aGrabBag)
{
if (aProp.Name == "Upright")
{
@@ -800,7 +800,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTextBoxBodyUpright)
sal_Int32 nAngle;
uno::Any aGeom = xShapeProperties->getPropertyValue("CustomShapeGeometry");
auto aGeomSeq = aGeom.get<Sequence<beans::PropertyValue>>();
- for (const auto& aProp : std::as_const(aGeomSeq))
+ for (const auto& aProp : aGeomSeq)
{
if (aProp.Name == "TextPreRotateAngle")
{
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 37a7bf73d35a..57098ed46fe6 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -2132,7 +2132,7 @@ static PivotFunc lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& x
if ( aSubAny >>= aSeq )
{
PivotFunc nMask = PivotFunc::NONE;
- for (const sal_Int16 nElem : std::as_const(aSeq))
+ for (const sal_Int16 nElem : aSeq)
nMask |= ScDataPilotConversion::FunctionBit(nElem);
return nMask;
}
diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx
index 08eedd67358d..66d8902de5f1 100644
--- a/sc/source/core/tool/addincol.cxx
+++ b/sc/source/core/tool/addincol.cxx
@@ -453,7 +453,7 @@ void ScUnoAddInCollection::ReadConfiguration()
uno::Sequence<beans::PropertyValue> aLocalEntries;
if ( aDisplayNameProperties[0] >>= aLocalEntries )
{
- for ( const beans::PropertyValue& rConfig : std::as_const(aLocalEntries) )
+ for (const beans::PropertyValue& rConfig : aLocalEntries)
{
// PropertyValue name is the locale ("convert" from
// string to canonicalize).
@@ -484,7 +484,7 @@ void ScUnoAddInCollection::ReadConfiguration()
uno::Sequence<beans::PropertyValue> aLocalEntries;
if ( aCompProperties[0] >>= aLocalEntries )
{
- for ( const beans::PropertyValue& rConfig : std::as_const(aLocalEntries) )
+ for (const beans::PropertyValue& rConfig : 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 516c1a67e91f..0a4cb09503c1 100644
--- a/sc/source/core/tool/appoptio.cxx
+++ b/sc/source/core/tool/appoptio.cxx
@@ -423,7 +423,7 @@ void ScAppCfg::ReadSortListCfg()
}
else
{
- for (const OUString& rStr : std::as_const(aSeq))
+ for (const OUString& rStr : aSeq)
{
aList.emplace_back(rStr);
}
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index 8420cc696a90..1d68152127d0 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -344,7 +344,7 @@ static ErrCode lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument,
uno::Sequence<beans::NamedValue> aStreams = xPackageEncryption->encrypt(xInputStream);
tools::SvRef<SotStorage> xEncryptedRootStrg = new SotStorage(pOriginalMediaStrm, false);
- for (const beans::NamedValue & aStreamData : std::as_const(aStreams))
+ for (const beans::NamedValue& aStreamData : aStreams)
{
// To avoid long paths split and open substorages recursively
// Splitting paths manually, since comphelper::string::split is trimming special characters like \0x01, \0x09
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 0926be90e5f2..d9ef2b2f3a7f 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -1934,7 +1934,7 @@ bool XclExpChSeries::ConvertDataSeries(
Sequence< sal_Int32 > aPointIndexes;
if( aSeriesProp.GetProperty( aPointIndexes, EXC_CHPROP_ATTRIBDATAPOINTS ) && aPointIndexes.hasElements() )
{
- for( const sal_Int32 nPointIndex : std::as_const(aPointIndexes) )
+ for (const sal_Int32 nPointIndex : aPointIndexes)
{
if (nPointIndex >= nMaxPointCount)
break;
diff --git a/sc/source/filter/excel/xepivotxml.cxx b/sc/source/filter/excel/xepivotxml.cxx
index fc8b118eae41..633499eadb5e 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -721,16 +721,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 : std::as_const(aSeqs))
+ for (const auto& a : aSeqs)
{
if (a >>= aFastSeq)
{
- for (const auto& rAttr : std::as_const(aFastSeq))
+ for (const auto& rAttr : aFastSeq)
rStrm.WriteAttributes(rAttr.Token, rAttr.Value);
}
else if (a >>= aUnkSeq)
{
- for (const auto& rAttr : std::as_const(aUnkSeq))
+ for (const auto& rAttr : aUnkSeq)
pStrm->write(" ")
->write(rAttr.Name)
->write("=\"")
diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx
index 7603d0f17833..464d30d9d2d8 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -1249,7 +1249,7 @@ bool OpCodeProviderImpl::fillTokenMap( ApiTokenMap& orTokenMap, OpCodeEntrySeque
orTokenMap.clear();
if( fillEntrySeq( orEntrySeq, rxMapper, nMapGroup ) )
{
- for( const FormulaOpCodeMapEntry& rEntry : std::as_const(orEntrySeq) )
+ for (const FormulaOpCodeMapEntry& rEntry : orEntrySeq)
orTokenMap[ rEntry.Name ] = rEntry.Token;
}
return orEntrySeq.hasElements();
@@ -1261,7 +1261,7 @@ bool OpCodeProviderImpl::fillFuncTokenMaps( ApiTokenMap& orIntFuncTokenMap, ApiT
orExtFuncTokenMap.clear();
if( fillEntrySeq( orEntrySeq, rxMapper, css::sheet::FormulaMapGroup::FUNCTIONS ) )
{
- for( const FormulaOpCodeMapEntry& rEntry : std::as_const(orEntrySeq) )
+ for (const FormulaOpCodeMapEntry& rEntry : 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 855c7dab40b0..2361122e0bfe 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -765,7 +765,7 @@ void WorkbookHelper::finalizeWorkbookImport()
OUString sTabName;
Reference< XNameAccess > xSheetsNC;
- for (const auto& rProp : std::as_const(aSeq))
+ for (const auto& rProp : aSeq)
{
OUString sName(rProp.Name);
if (sName == SC_ACTIVETABLE)
@@ -790,7 +790,7 @@ void WorkbookHelper::finalizeWorkbookImport()
if ( !(aAny >>= aProperties) )
return;
- for (const auto& rProp : std::as_const(aProperties))
+ for (const auto& rProp : 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 347f21d0f850..3068f10e54ef 100644
--- a/sc/source/filter/xml/XMLCodeNameProvider.cxx
+++ b/sc/source/filter/xml/XMLCodeNameProvider.cxx
@@ -32,7 +32,7 @@ bool XMLCodeNameProvider::_getCodeName( const uno::Any& aAny, OUString& rCodeNam
if( !(aAny >>= aProps) )
return false;
- for( const auto& rProp : std::as_const(aProps) )
+ for (const auto& rProp : aProps)
{
if( rProp.Name == "CodeName" )
{
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 4bbdc9669b12..243080b3b7f8 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1363,7 +1363,7 @@ void SAL_CALL ScXMLImport::endDocument()
uno::Sequence< beans::PropertyValue > aSeq;
if (xIndexAccess->getByIndex(0) >>= aSeq)
{
- for (const auto& rProp : std::as_const(aSeq))
+ for (const auto& rProp : 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 bf40b0092062..b6de0f3bcae8 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -1044,7 +1044,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 : std::as_const(maProperties))
+ for (const beans::PropertyValue& rValue : maProperties)
{
try
{
@@ -1075,7 +1075,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
for (nVarPos=0; nVarPos<nVarCount; ++nVarPos)
{
ScAddress aCellPos;
- ScUnoConversion::FillScAddress( aCellPos, std::as_const(aVariables)[nVarPos] );
+ ScUnoConversion::FillScAddress(aCellPos, aVariables[nVarPos]);
rFunc.SetValueCell(aCellPos, aSolution[nVarPos], false);
}
mpDocShell->UnlockPaint();
@@ -1113,7 +1113,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
{
ScAddress aCellPos;
ScUnoConversion::FillScAddress( aCellPos, aVariables[nVarPos] );
- rFunc.SetValueCell(aCellPos, std::as_const(aOldValues)[nVarPos], false);
+ rFunc.SetValueCell(aCellPos, aOldValues[nVarPos], false);
}
mpDocShell->UnlockPaint();
}
diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx
index 6a6a12d181a1..26457e43f1b9 100644
--- a/sc/source/ui/unoobj/appluno.cxx
+++ b/sc/source/ui/unoobj/appluno.cxx
@@ -256,7 +256,7 @@ void SAL_CALL ScSpreadsheetSettings::setPropertyValue(
// ScGlobal::SetUseTabCol does not do much else
pUserList->clear();
- for (const OUString& aEntry : std::as_const(aSeq))
+ for (const OUString& aEntry : aSeq)
{
pUserList->emplace_back(aEntry);
}
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index c99247af979f..c2dddbd74fad 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1555,7 +1555,7 @@ ScChart2DataProvider::createDataSource(
aSeqVector.push_back(aSeq);
}
- for( const sal_Int32 nNewIndex : std::as_const(aSequenceMapping) )
+ for (const sal_Int32 nNewIndex : aSequenceMapping)
{
// note: assuming that the values in the sequence mapping are always non-negative
::std::vector< uno::Reference< chart2::data::XLabeledDataSequence > >::size_type nOldIndex( static_cast< sal_uInt32 >( nNewIndex ) );
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index aa0554b27f7c..c905d68aff0a 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -529,7 +529,7 @@ void ScChartObj::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const uno:
if ( rValue >>= aCellRanges )
{
ScRangeListRef rRangeList = new ScRangeList();
- for ( table::CellRangeAddress const & aCellRange : std::as_const(aCellRanges) )
+ for (table::CellRangeAddress const& aCellRange : aCellRanges)
{
ScRange aRange;
ScUnoConversion::FillScRange( aRange, aCellRange );
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index d496c6c99134..1758bd36f2da 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -792,7 +792,7 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( const OUString& aProp
aServiceDesc = *pOldDesc;
OUString aStrVal;
- for (const beans::PropertyValue& rProp : std::as_const(aArgSeq))
+ for (const beans::PropertyValue& rProp : aArgSeq)
{
OUString aPropName(rProp.Name);
diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx
index 88a38763783c..8541cd0c031b 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 : std::as_const(aPropSeq))
+ for (const beans::PropertyValue& rProp : aPropSeq)
{
if ( rProp.Name == SC_UNO_EVENTTYPE )
{
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx
index 3316450da370..89e616f744e2 100644
--- a/sc/source/ui/unoobj/funcuno.cxx
+++ b/sc/source/ui/unoobj/funcuno.cxx
@@ -407,7 +407,7 @@ public:
sal_Int32 nStartRow = mrDocRow;
sal_Int32 nRowCount = maSeq.getLength();
sal_Int32 nMaxColCount = 0;
- for ( const uno::Sequence< seq >& rRow : std::as_const(maSeq) )
+ for (const uno::Sequence<seq>& rRow : maSeq)
{
sal_Int32 nColCount = rRow.getLength();
if ( nColCount > nMaxColCount )
diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index 5d1ecadb08a7..95a1f3f00c15 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -1361,7 +1361,7 @@ public:
uno::Sequence< beans::PropertyValue > aProperties;
aElement >>= aProperties;
bool isEventType = false;
- for( const beans::PropertyValue& rProperty : std::as_const(aProperties) )
+ for (const beans::PropertyValue& rProperty : aProperties)
{
if ( rProperty.Name == SC_EVENTACC_EVENTTYPE )
{
diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx
index bd552fbb03bc..bbe62435f97a 100644
--- a/sc/source/ui/vba/vbaworksheets.cxx
+++ b/sc/source/ui/vba/vbaworksheets.cxx
@@ -432,7 +432,7 @@ ScVbaWorksheets::Item(const uno::Any& Index, const uno::Any& Index2)
SheetMap aSheets;
uno::Sequence< uno::Any > sIndices;
aConverted >>= sIndices;
- for( const auto& rIndex : std::as_const(sIndices) )
+ for (const auto& rIndex : 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 8e7a5da93cc4..1f4f91307c44 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1861,7 +1861,7 @@ bool ScDBFunc::DataPilotMove( const ScRange& rSource, const ScAddress& rDest )
bool bInserted = false;
- for (const OUString& aMemberStr : std::as_const(aMemberNames))
+ for (const OUString& aMemberStr : aMemberNames)
{
if ( !bInserted && aMemberStr == aDestData.MemberName )
{
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index 57fb7f63b72d..c959be484d8b 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -132,7 +132,7 @@ public:
sal_Int32 dimensionIndex = 0;
OUString sPivotTableName("DataPilot1");
- for (beans::PropertyValue const & rProperty : std::as_const(aProperties))
+ for (beans::PropertyValue const& rProperty : aProperties)
{
if (rProperty.Name == "Rectangle")
rProperty.Value >>= xRectangle;