diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-15 11:40:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-15 13:15:50 +0200 |
commit | cf3fb54debffeab546085e648c73c576343be9f4 (patch) | |
tree | adc4bbd98fcbb86cb7b26823a5649abf508ef5a0 /forms | |
parent | fe00a724a918606e5c8c2c32b155bc50b33d56bd (diff) |
loplugin:sequenceloop in forms..oox
Change-Id: Id742001211e916e7709918e7112902a0c35bac95
Reviewed-on: https://gerrit.libreoffice.org/77501
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/ComboBox.cxx | 7 | ||||
-rw-r--r-- | forms/source/component/DatabaseForm.cxx | 5 | ||||
-rw-r--r-- | forms/source/component/Edit.cxx | 2 | ||||
-rw-r--r-- | forms/source/component/FormComponent.cxx | 4 | ||||
-rw-r--r-- | forms/source/component/ListBox.cxx | 2 |
5 files changed, 11 insertions, 9 deletions
diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index 62a0b54b1e14..912834f6d89d 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -415,7 +415,7 @@ void SAL_CALL OComboBoxModel::read(const Reference<css::io::XObjectInputStream>& m_aListSource.clear(); css::uno::Sequence<OUString> aListSource; _rxInStream >> aListSource; - for (const OUString& rToken : aListSource) + for (const OUString& rToken : std::as_const(aListSource)) m_aListSource += rToken; } @@ -642,7 +642,8 @@ void OComboBoxModel::loadData( bool _bForce ) Reference<XNameAccess> xFieldNames = getTableFields(xConnection, m_aListSource); if (xFieldNames.is()) { - for (const OUString& rustrNames : xFieldNames->getElementNames()) + const Sequence<OUString> aFieldNames = xFieldNames->getElementNames(); + for (const OUString& rustrNames : aFieldNames) aStringList.push_back(rustrNames); } } @@ -763,7 +764,7 @@ bool OComboBoxModel::commitControlValueToDbColumn( bool _bPostReset ) if ( getPropertyValue( PROPERTY_STRINGITEMLIST ) >>= aStringItemList ) { bool bFound = false; - for (const OUString& rStringItem : aStringItemList) + for (const OUString& rStringItem : std::as_const(aStringItemList)) { if ( (bFound = rStringItem == sNewValue) ) break; diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index a24e9eee91da..4f621a7d5e60 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -305,7 +305,7 @@ ODatabaseForm::ODatabaseForm( const ODatabaseForm& _cloneSource ) Reference< XPropertySetInfo > xDestPSI( getPropertySetInfo(), UNO_SET_THROW ); - Sequence< Property > aSourceProperties( xSourcePSI->getProperties() ); + const Sequence< Property > aSourceProperties( xSourcePSI->getProperties() ); for ( auto const & sourceProperty : aSourceProperties ) { if ( xDestPSI->hasPropertyByName( sourceProperty.Name ) ) @@ -631,7 +631,8 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc // Find the right control bool bFound = false; - for( auto const& xControl : xControlContainer->getControls() ) + const Sequence<Reference<XControl>> aControls = xControlContainer->getControls(); + for( auto const& xControl : aControls ) { Reference<XPropertySet> xModel(xControl->getModel(), UNO_QUERY); if ((bFound = xModel == xComponentSet)) diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx index 3573224206b1..4ab433ff4fcf 100644 --- a/forms/source/component/Edit.cxx +++ b/forms/source/component/Edit.cxx @@ -418,7 +418,7 @@ namespace return; } - Sequence< Property > aSourceProps( xSourceInfo->getProperties() ); + const Sequence< Property > aSourceProps( xSourceInfo->getProperties() ); for ( auto const & sourceprop : aSourceProps ) { if ( !xDestInfo->hasPropertyByName( sourceprop.Name ) ) diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx index eb4cbf3f9598..e0c7b3e04bd6 100644 --- a/forms/source/component/FormComponent.cxx +++ b/forms/source/component/FormComponent.cxx @@ -2366,7 +2366,7 @@ bool OBoundControlModel::impl_approveValueBinding_nolock( const Reference< XValu // < SYNCHRONIZED } - for ( auto const & type : aTypeCandidates ) + for ( auto const & type : std::as_const(aTypeCandidates) ) { if ( _rxBinding->supportsType( type ) ) return true; @@ -2594,7 +2594,7 @@ void OBoundControlModel::calculateExternalValueType() m_aExternalValueType = Type(); if ( !m_xExternalBinding.is() ) return; - Sequence< Type > aTypeCandidates( getSupportedBindingTypes() ); + const Sequence< Type > aTypeCandidates( getSupportedBindingTypes() ); for ( auto const & typeCandidate : aTypeCandidates ) { if ( m_xExternalBinding->supportsType( typeCandidate ) ) diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index c6abd1b8c882..95a80552370c 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -1417,7 +1417,7 @@ namespace frm ::std::set< sal_Int16 > aSelectionSet; // find the selection entries in our item list - for ( OUString const & selectEntry : aSelectEntries ) + for ( OUString const & selectEntry : std::as_const(aSelectEntries) ) { int idx = 0; for(const OUString& s : getStringItemList()) |