summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-08-15 11:26:29 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-08-15 14:18:49 +0200
commit5a526f9196a8aeb527a2fc6d7c081812770c28be (patch)
tree076a324476d79bf397fb97d5884db571106425e8 /extensions
parentcf3fb54debffeab546085e648c73c576343be9f4 (diff)
loplugin:sequenceloop dbaccess..extensions
Change-Id: I0eb33a8e293eb8afd0cf5a933384c44e023a2e6b Reviewed-on: https://gerrit.libreoffice.org/77498 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/bibliography/datman.cxx6
-rw-r--r--extensions/source/propctrlr/eventhandler.cxx3
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx17
-rw-r--r--extensions/source/propctrlr/genericpropertyhandler.cxx2
-rw-r--r--extensions/source/propctrlr/propcontroller.cxx2
-rw-r--r--extensions/source/propctrlr/taborder.cxx5
6 files changed, 21 insertions, 14 deletions
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index aaaff07f1b6e..64201ff405fb 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -318,7 +318,8 @@ MappingDialog_Impl::MappingDialog_Impl(weld::Window* pParent, BibDataManager* pM
DBG_ASSERT(xFields.is(), "MappingDialog_Impl::MappingDialog_Impl : gave me an invalid form !");
if (xFields.is())
{
- for(const OUString& rName : xFields->getElementNames())
+ const Sequence<OUString> aFieldNames = xFields->getElementNames();
+ for(const OUString& rName : aFieldNames)
aListBoxes[0]->append_text(rName);
}
@@ -579,7 +580,8 @@ void BibDataManager::InsertFields(const Reference< XFormComponent > & _rxGrid)
Reference< XPropertySet > xField;
- for ( const OUString& rField : xFields->getElementNames() )
+ const Sequence<OUString> aFieldNames = xFields->getElementNames();
+ for ( const OUString& rField : aFieldNames )
{
xFields->getByName( rField ) >>= xField;
diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx
index d53cdba2172c..badaab0d23e7 100644
--- a/extensions/source/propctrlr/eventhandler.cxx
+++ b/extensions/source/propctrlr/eventhandler.cxx
@@ -702,7 +702,8 @@ namespace pcr
continue;
// loop through all methods
- for (const OUString& rMethod : comphelper::getEventMethodsForType( rListener ))
+ const Sequence<OUString> aEventMethods = comphelper::getEventMethodsForType( rListener );
+ for (const OUString& rMethod : aEventMethods)
{
EventDescription aEvent;
if ( !lcl_getEventDescriptionForMethod( rMethod, aEvent ) )
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 93464c0f2669..e65f62ac8b2d 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -277,7 +277,7 @@ namespace pcr
aResolvedStrings.reserve( aStrings.getLength() );
try
{
- for ( const OUString& rIdStr : aStrings )
+ for ( const OUString& rIdStr : std::as_const(aStrings) )
{
OUString aPureIdStr = rIdStr.copy( 1 );
if( xStringResourceResolver->hasEntryForId( aPureIdStr ) )
@@ -330,7 +330,7 @@ namespace pcr
if( ! (_rValue >>= aFontPropertyValues) )
SAL_WARN("extensions.propctrlr", "setPropertyValue: unable to get property " << PROPERTY_ID_FONT);
- for ( const NamedValue& fontPropertyValue : aFontPropertyValues )
+ for ( const NamedValue& fontPropertyValue : std::as_const(aFontPropertyValues) )
m_xComponent->setPropertyValue( fontPropertyValue.Name, fontPropertyValue.Value );
}
else
@@ -392,7 +392,7 @@ namespace pcr
}
// Move strings to new Ids for all locales
- Sequence< Locale > aLocaleSeq = xStringResourceManager->getLocales();
+ const Sequence< Locale > aLocaleSeq = xStringResourceManager->getLocales();
Sequence< OUString > aOldIdStrings;
aPropertyValue >>= aOldIdStrings;
try
@@ -445,7 +445,7 @@ namespace pcr
aValue <<= aNewIdStrings;
// Remove old ids from resource for all locales
- for( const OUString& rIdStr : aOldIdStrings )
+ for( const OUString& rIdStr : std::as_const(aOldIdStrings) )
{
OUString aPureIdStr = rIdStr.copy( 1 );
for ( const Locale& rLocale : aLocaleSeq )
@@ -2365,7 +2365,8 @@ namespace pcr
if( ! (xFormSet->getPropertyValue( PROPERTY_COMMANDTYPE ) >>= nObjectType) )
SAL_WARN("extensions.propctrlr", "impl_initFieldList_nothrow: unable to get property " PROPERTY_COMMANDTYPE);
- for ( const OUString& rField : ::dbtools::getFieldNamesByCommandDescriptor( m_xRowSetConnection, nObjectType, sObjectName ) )
+ const Sequence<OUString> aNames = ::dbtools::getFieldNamesByCommandDescriptor( m_xRowSetConnection, nObjectType, sObjectName );
+ for ( const OUString& rField : aNames )
_rFieldNames.push_back( rField );
}
}
@@ -2500,7 +2501,8 @@ namespace pcr
if ( !xTableNames.is() )
return;
- for ( const OUString& rTableName : xTableNames->getElementNames() )
+ const Sequence<OUString> aNames = xTableNames->getElementNames();
+ for ( const OUString& rTableName : aNames )
_out_rNames.push_back( rTableName );
}
@@ -2527,7 +2529,8 @@ namespace pcr
bool bAdd = !_sName.isEmpty();
- for ( const OUString& rQueryName : _xQueryNames->getElementNames() )
+ const Sequence<OUString> aQueryNames =_xQueryNames->getElementNames();
+ for ( const OUString& rQueryName : aQueryNames )
{
OUStringBuffer sTemp;
if ( bAdd )
diff --git a/extensions/source/propctrlr/genericpropertyhandler.cxx b/extensions/source/propctrlr/genericpropertyhandler.cxx
index 20e668c569a3..955426c434ce 100644
--- a/extensions/source/propctrlr/genericpropertyhandler.cxx
+++ b/extensions/source/propctrlr/genericpropertyhandler.cxx
@@ -470,7 +470,7 @@ namespace pcr
aProperties = xPSI->getProperties();
DBG_ASSERT( aProperties.hasElements(), "GenericPropertyHandler::getSupportedProperties: no properties!" );
- for ( auto const & property : aProperties )
+ for ( auto const & property : std::as_const(aProperties) )
{
switch ( property.Type.getTypeClass() )
{
diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx
index 1b789bf86764..862f76c4154e 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -1413,7 +1413,7 @@ namespace pcr
if ( m_xModel.is() )
aHandlerFactories = m_xModel->getHandlerFactories();
- for ( auto const & handlerFactory : aHandlerFactories )
+ for ( auto const & handlerFactory : std::as_const(aHandlerFactories) )
{
if ( _rObjects.size() == 1 )
{ // we're inspecting only one object -> one handler
diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx
index 8163ce6c3c3b..3fc08b9599a5 100644
--- a/extensions/source/propctrlr/taborder.cxx
+++ b/extensions/source/propctrlr/taborder.cxx
@@ -165,7 +165,8 @@ namespace pcr
OUString aName;
OUString aImage;
- for ( auto const& rControlModel : m_xTempModel->getControlModels() )
+ const Sequence<Reference<css::awt::XControlModel>> aControlModels = m_xTempModel->getControlModels();
+ for ( auto const& rControlModel : aControlModels )
{
Reference< XPropertySet > xControl( rControlModel, UNO_QUERY );
Reference< XPropertySetInfo > xPI;
@@ -237,7 +238,7 @@ namespace pcr
{
int nEntryCount = m_xLB_Controls->n_children();
Sequence< Reference< XControlModel > > aSortedControlModelSeq( nEntryCount );
- Sequence< Reference< XControlModel > > aControlModels( m_xTempModel->getControlModels());
+ const Sequence< Reference< XControlModel > > aControlModels( m_xTempModel->getControlModels());
Reference< XControlModel > * pSortedControlModels = aSortedControlModelSeq.getArray();
for (int i = 0; i < nEntryCount; ++i)