summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-10 16:12:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-11 12:50:55 +0200
commit20571c472528c4f98fe3f55700d134915d32a49a (patch)
tree9b350824d845b8aaeb13d087ef74febb454b821b /dbaccess/source
parentb401896a56149aa2871b65a330a6f601a9830ccd (diff)
use more range-for on uno::Sequence
Change-Id: Ifad32425d79be5a22d33d721bdc5fb993f699759 Reviewed-on: https://gerrit.libreoffice.org/39763 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/core/api/TableDeco.cxx28
-rw-r--r--dbaccess/source/core/api/table.cxx20
-rw-r--r--dbaccess/source/ext/macromigration/migrationengine.cxx16
-rw-r--r--dbaccess/source/ui/browser/sbamultiplex.cxx5
4 files changed, 29 insertions, 40 deletions
diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx
index d80677ecb746..cf8c115bf028 100644
--- a/dbaccess/source/core/api/TableDeco.cxx
+++ b/dbaccess/source/core/api/TableDeco.cxx
@@ -315,22 +315,20 @@ void ODBTableDecorator::construct()
Reference<XPropertySetInfo> xInfo = xProp->getPropertySetInfo();
Sequence< Property > aTableProps = xInfo->getProperties();
- Property* pIter = aTableProps.getArray();
- Property* pEnd = pIter + aTableProps.getLength();
- for (;pIter != pEnd ; ++pIter)
+ for (Property & prop : aTableProps)
{
- if (pIter->Name == PROPERTY_CATALOGNAME)
- pIter->Handle = PROPERTY_ID_CATALOGNAME;
- else if (pIter->Name == PROPERTY_SCHEMANAME)
- pIter->Handle = PROPERTY_ID_SCHEMANAME;
- else if (pIter->Name == PROPERTY_NAME)
- pIter->Handle = PROPERTY_ID_NAME;
- else if (pIter->Name == PROPERTY_DESCRIPTION)
- pIter->Handle = PROPERTY_ID_DESCRIPTION;
- else if (pIter->Name == PROPERTY_TYPE)
- pIter->Handle = PROPERTY_ID_TYPE;
- else if (pIter->Name == PROPERTY_PRIVILEGES)
- pIter->Handle = PROPERTY_ID_PRIVILEGES;
+ if (prop.Name == PROPERTY_CATALOGNAME)
+ prop.Handle = PROPERTY_ID_CATALOGNAME;
+ else if (prop.Name == PROPERTY_SCHEMANAME)
+ prop.Handle = PROPERTY_ID_SCHEMANAME;
+ else if (prop.Name == PROPERTY_NAME)
+ prop.Handle = PROPERTY_ID_NAME;
+ else if (prop.Name == PROPERTY_DESCRIPTION)
+ prop.Handle = PROPERTY_ID_DESCRIPTION;
+ else if (prop.Name == PROPERTY_TYPE)
+ prop.Handle = PROPERTY_ID_TYPE;
+ else if (prop.Name == PROPERTY_PRIVILEGES)
+ prop.Handle = PROPERTY_ID_PRIVILEGES;
}
describeProperties(aTableProps);
diff --git a/dbaccess/source/core/api/table.cxx b/dbaccess/source/core/api/table.cxx
index f426b9d992cd..291f597fb7db 100644
--- a/dbaccess/source/core/api/table.cxx
+++ b/dbaccess/source/core/api/table.cxx
@@ -220,18 +220,16 @@ void ODBTable::construct()
describeProperties(aProps);
if(!_nId)
{
- Property* pIter = aProps.getArray();
- Property* pEnd = pIter + aProps.getLength();
- for(;pIter != pEnd;++pIter)
+ for(Property & prop : aProps)
{
- if (pIter->Name == PROPERTY_CATALOGNAME)
- pIter->Attributes = PropertyAttribute::READONLY;
- else if (pIter->Name == PROPERTY_SCHEMANAME)
- pIter->Attributes = PropertyAttribute::READONLY;
- else if (pIter->Name == PROPERTY_DESCRIPTION)
- pIter->Attributes = PropertyAttribute::READONLY;
- else if (pIter->Name == PROPERTY_NAME)
- pIter->Attributes = PropertyAttribute::READONLY;
+ if (prop.Name == PROPERTY_CATALOGNAME)
+ prop.Attributes = PropertyAttribute::READONLY;
+ else if (prop.Name == PROPERTY_SCHEMANAME)
+ prop.Attributes = PropertyAttribute::READONLY;
+ else if (prop.Name == PROPERTY_DESCRIPTION)
+ prop.Attributes = PropertyAttribute::READONLY;
+ else if (prop.Name == PROPERTY_NAME)
+ prop.Attributes = PropertyAttribute::READONLY;
}
}
diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx
index cd1477fcc1a2..8b0b7a3c8a5f 100644
--- a/dbaccess/source/ext/macromigration/migrationengine.cxx
+++ b/dbaccess/source/ext/macromigration/migrationengine.cxx
@@ -1664,18 +1664,15 @@ namespace dbmm
Reference< XNameReplace > xEvents( xEventsSupplier->getEvents(), UNO_QUERY_THROW );
Sequence< OUString > aEventNames( xEvents->getElementNames() );
- const OUString* eventName = aEventNames.getArray();
- const OUString* eventNamesEnd = eventName + aEventNames.getLength();
-
ScriptEventDescriptor aScriptEvent;
- for ( ; eventName != eventNamesEnd; ++eventName )
+ for ( OUString const & eventName : aEventNames )
{
- OSL_VERIFY( xEvents->getByName( *eventName ) >>= aScriptEvent );
+ OSL_VERIFY( xEvents->getByName( eventName ) >>= aScriptEvent );
if ( !impl_adjustScriptLibrary_nothrow( aScriptEvent ) )
continue;
- xEvents->replaceByName( *eventName, makeAny( aScriptEvent ) );
+ xEvents->replaceByName( eventName, makeAny( aScriptEvent ) );
}
}
@@ -1731,12 +1728,9 @@ namespace dbmm
Sequence< ScriptEventDescriptor > aEvents( aComponent.getEvents() );
bool bChangedComponentEvents = false;
- for ( ScriptEventDescriptor* scriptEvent = aEvents.getArray();
- scriptEvent != aEvents.getArray() + aEvents.getLength();
- ++scriptEvent
- )
+ for ( ScriptEventDescriptor & scriptEvent : aEvents )
{
- if ( !impl_adjustScriptLibrary_nothrow( *scriptEvent ) )
+ if ( !impl_adjustScriptLibrary_nothrow( scriptEvent ) )
continue;
bChangedComponentEvents = true;
diff --git a/dbaccess/source/ui/browser/sbamultiplex.cxx b/dbaccess/source/ui/browser/sbamultiplex.cxx
index f6ae47d866a8..459b743a37a1 100644
--- a/dbaccess/source/ui/browser/sbamultiplex.cxx
+++ b/dbaccess/source/ui/browser/sbamultiplex.cxx
@@ -85,9 +85,8 @@ void SbaXPropertiesChangeMultiplexer::propertiesChange(const css::uno::Sequence<
// forwards _all_ changes to _all_ listeners
css::uno::Sequence< css::beans::PropertyChangeEvent> aMulti(aEvts);
- css::beans::PropertyChangeEvent* pMulti = aMulti.getArray();
- for (sal_Int32 i=0; i<aMulti.getLength(); ++i, ++pMulti)
- pMulti->Source = &m_rParent;
+ for (css::beans::PropertyChangeEvent & rEvent : aMulti)
+ rEvent.Source = &m_rParent;
::comphelper::OInterfaceIteratorHelper2 aIt(*this);
while (aIt.hasMoreElements())