loplugin:sequenceloop in scaddins..scripting
Change-Id: I25044332e107b630b257e48d95ee9272145ed344 Reviewed-on: https://gerrit.libreoffice.org/77524 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -1481,7 +1481,7 @@ void SortedIndividualInt32List::InsertHolidayList(
|
||||
if( !(rHolAny >>= aAnySeq) )
|
||||
throw lang::IllegalArgumentException();
|
||||
|
||||
for( const uno::Sequence< uno::Any >& rSubSeq : aAnySeq )
|
||||
for( const uno::Sequence< uno::Any >& rSubSeq : std::as_const(aAnySeq) )
|
||||
{
|
||||
for( const uno::Any& rAny : rSubSeq )
|
||||
InsertHolidayList( rAnyConv, rAny, nNullDate, false/*bInsertOnWeekend*/ );
|
||||
@@ -2036,7 +2036,7 @@ void ComplexList::Append( const uno::Sequence< uno::Any >& aMultPars )
|
||||
if( !(r >>= aValArr) )
|
||||
throw lang::IllegalArgumentException();
|
||||
|
||||
for( const uno::Sequence< uno::Any >& rArr : aValArr )
|
||||
for( const uno::Sequence< uno::Any >& rArr : std::as_const(aValArr) )
|
||||
Append( rArr );
|
||||
}
|
||||
break;
|
||||
|
@@ -72,7 +72,7 @@ void SAL_CALL CoinMPSolver::solve()
|
||||
ScSolverCellHashMap aCellsHash;
|
||||
aCellsHash[maObjective].reserve( nVariables + 1 ); // objective function
|
||||
|
||||
for (const auto& rConstr : maConstraints)
|
||||
for (const auto& rConstr : std::as_const(maConstraints))
|
||||
{
|
||||
table::CellAddress aCellAddr = rConstr.Left;
|
||||
aCellsHash[aCellAddr].reserve( nVariables + 1 ); // constraints: left hand side
|
||||
@@ -255,7 +255,7 @@ void SAL_CALL CoinMPSolver::solve()
|
||||
|
||||
// apply single-var integer constraints
|
||||
|
||||
for (const auto& rConstr : maConstraints)
|
||||
for (const auto& rConstr : std::as_const(maConstraints))
|
||||
{
|
||||
sheet::SolverConstraintOperator eOp = rConstr.Operator;
|
||||
if ( eOp == sheet::SolverConstraintOperator_INTEGER ||
|
||||
|
@@ -107,7 +107,7 @@ void SAL_CALL LpsolveSolver::solve()
|
||||
ScSolverCellHashMap aCellsHash;
|
||||
aCellsHash[maObjective].reserve( nVariables + 1 ); // objective function
|
||||
|
||||
for (const auto& rConstr : maConstraints)
|
||||
for (const auto& rConstr : std::as_const(maConstraints))
|
||||
{
|
||||
table::CellAddress aCellAddr = rConstr.Left;
|
||||
aCellsHash[aCellAddr].reserve( nVariables + 1 ); // constraints: left hand side
|
||||
@@ -192,7 +192,7 @@ void SAL_CALL LpsolveSolver::solve()
|
||||
|
||||
set_add_rowmode(lp, TRUE);
|
||||
|
||||
for (const auto& rConstr : maConstraints)
|
||||
for (const auto& rConstr : std::as_const(maConstraints))
|
||||
{
|
||||
// integer constraints are set later
|
||||
sheet::SolverConstraintOperator eOp = rConstr.Operator;
|
||||
@@ -260,7 +260,7 @@ void SAL_CALL LpsolveSolver::solve()
|
||||
|
||||
// apply single-var integer constraints
|
||||
|
||||
for (const auto& rConstr : maConstraints)
|
||||
for (const auto& rConstr : std::as_const(maConstraints))
|
||||
{
|
||||
sheet::SolverConstraintOperator eOp = rConstr.Operator;
|
||||
if ( eOp == sheet::SolverConstraintOperator_INTEGER ||
|
||||
|
@@ -513,7 +513,7 @@ void SAL_CALL SwarmSolver::solve()
|
||||
}
|
||||
|
||||
// Determine variable bounds
|
||||
for (sheet::SolverConstraint const& rConstraint : maConstraints)
|
||||
for (sheet::SolverConstraint const& rConstraint : std::as_const(maConstraints))
|
||||
{
|
||||
table::CellAddress aLeftCellAddress = rConstraint.Left;
|
||||
sheet::SolverConstraintOperator eOp = rConstraint.Operator;
|
||||
|
@@ -425,7 +425,7 @@ namespace basprov
|
||||
|
||||
if ( pBasicManager && xLibContainer.is() )
|
||||
{
|
||||
Sequence< OUString > aLibNames = xLibContainer->getElementNames();
|
||||
const Sequence< OUString > aLibNames = xLibContainer->getElementNames();
|
||||
sal_Int32 nLibCount = aLibNames.getLength();
|
||||
aChildNodes.realloc( nLibCount );
|
||||
Reference< browse::XBrowseNode >* pChildNodes = aChildNodes.getArray();
|
||||
|
@@ -220,7 +220,7 @@ namespace dlgprov
|
||||
Reference< XPropertySet > xProps( xControlModel, uno::UNO_QUERY );
|
||||
if ( xEventCont.is() )
|
||||
{
|
||||
Sequence< OUString > aNames = xEventCont->getElementNames();
|
||||
const Sequence< OUString > aNames = xEventCont->getElementNames();
|
||||
|
||||
for ( const OUString& rName : aNames )
|
||||
{
|
||||
|
@@ -324,7 +324,7 @@ namespace dlgprov
|
||||
}
|
||||
else
|
||||
{
|
||||
Sequence< OUString > aOpenDocsTdocURLs( MiscUtils::allOpenTDocUrls( m_xContext ) );
|
||||
const Sequence< OUString > aOpenDocsTdocURLs( MiscUtils::allOpenTDocUrls( m_xContext ) );
|
||||
for ( auto const & tdocURL : aOpenDocsTdocURLs )
|
||||
{
|
||||
Reference< frame::XModel > xModel( MiscUtils::tDocUrlToModel( tdocURL ) );
|
||||
|
@@ -215,7 +215,7 @@ private:
|
||||
{
|
||||
m_hBNA.reset( new std::unordered_map< OUString, Reference< browse::XBrowseNode > > );
|
||||
|
||||
Sequence< Reference< browse::XBrowseNode > > langNodes =
|
||||
const Sequence< Reference< browse::XBrowseNode > > langNodes =
|
||||
m_origNode->getChildNodes();
|
||||
|
||||
for ( const auto& rLangNode : langNodes )
|
||||
@@ -230,7 +230,7 @@ private:
|
||||
xbn.set( rLangNode );
|
||||
}
|
||||
|
||||
Sequence< Reference< browse::XBrowseNode > > grandchildren =
|
||||
const Sequence< Reference< browse::XBrowseNode > > grandchildren =
|
||||
xbn->getChildNodes();
|
||||
|
||||
for ( const Reference< browse::XBrowseNode >& grandchild : grandchildren )
|
||||
@@ -262,7 +262,7 @@ namespace
|
||||
|
||||
std::vector< Reference< browse::XBrowseNode > > getAllBrowseNodes( const Reference< XComponentContext >& xCtx )
|
||||
{
|
||||
Sequence< OUString > openDocs =
|
||||
const Sequence< OUString > openDocs =
|
||||
MiscUtils::allOpenTDocUrls( xCtx );
|
||||
|
||||
Reference< provider::XScriptProviderFactory > xFac;
|
||||
@@ -395,7 +395,7 @@ public:
|
||||
if ( hasChildNodes() )
|
||||
{
|
||||
vXBrowseNodes aVNodes;
|
||||
Sequence < Reference< browse::XBrowseNode > > nodes =
|
||||
const Sequence < Reference< browse::XBrowseNode > > nodes =
|
||||
m_xWrappedBrowseNode->getChildNodes();
|
||||
for ( const Reference< browse::XBrowseNode >& xBrowseNode : nodes )
|
||||
{
|
||||
|
@@ -380,7 +380,7 @@ ScriptEventHelper::getEventListeners()
|
||||
|
||||
Reference< beans::XIntrospectionAccess > xIntrospectionAccess =
|
||||
xIntrospection->inspect( makeAny( m_xControl ) );
|
||||
Sequence< Type > aControlListeners =
|
||||
const Sequence< Type > aControlListeners =
|
||||
xIntrospectionAccess->getSupportedListeners();
|
||||
for ( const Type& listType : aControlListeners )
|
||||
{
|
||||
@@ -397,7 +397,7 @@ ScriptEventHelper::getEventListeners()
|
||||
Sequence< ScriptEventDescriptor >
|
||||
ScriptEventHelper::createEvents( const OUString& sCodeName )
|
||||
{
|
||||
Sequence< OUString > aControlListeners = getEventListeners();
|
||||
const Sequence< OUString > aControlListeners = getEventListeners();
|
||||
sal_Int32 nLength = aControlListeners.getLength();
|
||||
|
||||
Sequence< ScriptEventDescriptor > aDest( nLength );
|
||||
|
Reference in New Issue
Block a user