diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-05 13:27:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-06 08:35:23 +0200 |
commit | ab9b38a4064141705aa3a3de9a5d73b465ad3af3 (patch) | |
tree | 888fcc6b517c44d77e2d297c13ee84fb487dd7a7 /dbaccess | |
parent | 13341ffa49d58f313a05edae4f4f04c215658e9f (diff) |
use more begin()/end() for Sequence
Change-Id: I399be6b6ef7a6ce01e883569a177c0969bc29c69
Diffstat (limited to 'dbaccess')
20 files changed, 77 insertions, 127 deletions
diff --git a/dbaccess/source/core/api/definitioncolumn.cxx b/dbaccess/source/core/api/definitioncolumn.cxx index 572c6c2eebac..a3ef15206420 100644 --- a/dbaccess/source/core/api/definitioncolumn.cxx +++ b/dbaccess/source/core/api/definitioncolumn.cxx @@ -474,12 +474,9 @@ Sequence< OUString > OTableColumnDescriptorWrapper::getSupportedServiceNames( ) if ( !m_bIsDescriptor ) { - for ( Property* prop = aDescriptor.getArray(); - prop != aDescriptor.getArray() + aDescriptor.getLength(); - ++prop - ) + for ( auto & prop : aDescriptor ) { - prop->Attributes |= PropertyAttribute::READONLY; + prop.Attributes |= PropertyAttribute::READONLY; } } diff --git a/dbaccess/source/core/api/resultset.cxx b/dbaccess/source/core/api/resultset.cxx index a8fe61e40fdc..320e2fc4f596 100644 --- a/dbaccess/source/core/api/resultset.cxx +++ b/dbaccess/source/core/api/resultset.cxx @@ -366,15 +366,12 @@ Reference< css::container::XNameAccess > OResultSet::getColumns() const Sequence< OUString > aNames( xColNames->getElementNames() ); SAL_WARN_IF( aNames.getLength() != nColCount, "dbaccess", "OResultSet::getColumns: invalid column count!" ); - for ( const OUString* pName = aNames.getConstArray(); - pName != aNames.getConstArray() + aNames.getLength(); - ++pName - ) + for ( auto const & name : aNames ) { - Reference< XPropertySet > xColProps( xColNames->getByName( *pName ), UNO_QUERY_THROW ); + Reference< XPropertySet > xColProps( xColNames->getByName( name ), UNO_QUERY_THROW ); OUString sName; OSL_VERIFY( xColProps->getPropertyValue( PROPERTY_NAME ) >>= sName ); - SAL_WARN_IF( sName != *pName, "dbaccess", "OResultSet::getColumns: invalid column name!" ); + SAL_WARN_IF( sName != name, "dbaccess", "OResultSet::getColumns: invalid column name!" ); } } diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx index d72e534bb450..4c36eb9982c9 100644 --- a/dbaccess/source/core/dataaccess/connection.cxx +++ b/dbaccess/source/core/dataaccess/connection.cxx @@ -772,12 +772,9 @@ void OConnection::impl_checkTableQueryNames_nothrow() Reference< XNameAccess > xQueries( getQueries() ); Sequence< OUString > aQueryNames( xQueries->getElementNames() ); - for ( const OUString* pQueryName = aQueryNames.getConstArray(); - pQueryName != aQueryNames.getConstArray() + aQueryNames.getLength(); - ++pQueryName - ) + for ( auto const & queryName : aQueryNames ) { - if ( aSortedTableNames.find( *pQueryName ) != aSortedTableNames.end() ) + if ( aSortedTableNames.find( queryName ) != aSortedTableNames.end() ) { OUString sConflictWarning( DBA_RES( RID_STR_CONFLICTING_NAMES ) ); m_aWarnings.appendWarning( sConflictWarning, "01SB0", *this ); diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx index 7f6ac225a0b1..237db1fce2fe 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.cxx +++ b/dbaccess/source/core/dataaccess/databasecontext.cxx @@ -401,17 +401,15 @@ void ODatabaseContext::setTransientProperties(const OUString& _sURL, ODatabaseMo OUString sAuthFailedPassword; Reference< XPropertySet > xDSProps( _rDataSourceModel.getOrCreateDataSource(), UNO_QUERY_THROW ); const Sequence< PropertyValue >& rSessionPersistentProps = m_aDatasourceProperties[_sURL]; - const PropertyValue* pProp = rSessionPersistentProps.getConstArray(); - const PropertyValue* pPropsEnd = rSessionPersistentProps.getConstArray() + rSessionPersistentProps.getLength(); - for ( ; pProp != pPropsEnd; ++pProp ) + for ( auto const & prop : rSessionPersistentProps ) { - if ( pProp->Name == "AuthFailedPassword" ) + if ( prop.Name == "AuthFailedPassword" ) { - OSL_VERIFY( pProp->Value >>= sAuthFailedPassword ); + OSL_VERIFY( prop.Value >>= sAuthFailedPassword ); } else { - xDSProps->setPropertyValue( pProp->Name, pProp->Value ); + xDSProps->setPropertyValue( prop.Name, prop.Value ); } } diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index dc917cf7a72f..c49ea30d9d54 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -245,8 +245,8 @@ Sequence< Type > SAL_CALL ODatabaseDocument::getTypes( ) aTypes = Sequence< Type >( pStripTo, std::remove_copy_if( - aTypes.getConstArray(), - aTypes.getConstArray() + aTypes.getLength(), + aTypes.begin(), + aTypes.end(), pStripTo, std::bind2nd( std::equal_to< Type >(), cppu::UnoType<XEmbeddedScripts>::get() ) ) - pStripTo @@ -256,8 +256,8 @@ Sequence< Type > SAL_CALL ODatabaseDocument::getTypes( ) aTypes = Sequence< Type >( pStripTo, std::remove_copy_if( - aTypes.getConstArray(), - aTypes.getConstArray() + aTypes.getLength(), + aTypes.begin(), + aTypes.end(), pStripTo, std::bind2nd( std::equal_to< Type >(), cppu::UnoType<XScriptInvocationContext>::get() ) ) - pStripTo @@ -594,13 +594,11 @@ namespace Reference< css::sdb::application::XDatabaseDocumentUI > xDatabaseUI( i_rController, UNO_QUERY_THROW ); Sequence< Reference< XComponent > > aComponents( xDatabaseUI->getSubComponents() ); - const Reference< XComponent >* component = aComponents.getConstArray(); - const Reference< XComponent >* componentsEnd = aComponents.getConstArray() + aComponents.getLength(); bool isAnyModified = false; - for ( ; component != componentsEnd; ++component ) + for ( auto const & xComponent : aComponents ) { - Reference< XModifiable > xModify( *component, UNO_QUERY ); + Reference< XModifiable > xModify( xComponent, UNO_QUERY ); if ( xModify.is() ) { isAnyModified = xModify->isModified(); diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.cxx b/dbaccess/source/core/dataaccess/databaseregistrations.cxx index 6734c2e7dc57..be0d94e2d2b7 100644 --- a/dbaccess/source/core/dataaccess/databaseregistrations.cxx +++ b/dbaccess/source/core/dataaccess/databaseregistrations.cxx @@ -150,12 +150,9 @@ namespace dbaccess ::utl::OConfigurationNode DatabaseRegistrations::impl_getNodeForName_nothrow( const OUString& _rName ) { Sequence< OUString > aNames( m_aConfigurationRoot.getNodeNames() ); - for ( const OUString* pName = aNames.getConstArray(); - pName != aNames.getConstArray() + aNames.getLength(); - ++pName - ) + for ( auto const & nodeName : aNames ) { - ::utl::OConfigurationNode aNodeForName = m_aConfigurationRoot.openNode( *pName ); + ::utl::OConfigurationNode aNodeForName = m_aConfigurationRoot.openNode( nodeName ); OUString sTestName; OSL_VERIFY( aNodeForName.getNodeValue( getNameNodeName() ) >>= sTestName ); @@ -244,13 +241,11 @@ namespace dbaccess Sequence< OUString > aDisplayNames( aProgrammaticNames.getLength() ); OUString* pDisplayName = aDisplayNames.getArray(); - for ( const OUString* pName = aProgrammaticNames.getConstArray(); - pName != aProgrammaticNames.getConstArray() + aProgrammaticNames.getLength(); - ++pName, ++pDisplayName - ) + for ( auto const & name : aProgrammaticNames ) { - ::utl::OConfigurationNode aRegistrationNode = m_aConfigurationRoot.openNode( *pName ); + ::utl::OConfigurationNode aRegistrationNode = m_aConfigurationRoot.openNode( name ); OSL_VERIFY( aRegistrationNode.getNodeValue( getNameNodeName() ) >>= *pDisplayName ); + ++pDisplayName; } return aDisplayNames; diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 81df15a36620..88b29f800642 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -759,11 +759,9 @@ sal_Bool ODatabaseSource::convertFastPropertyValue(Any & rConvertedValue, Any & if (!(rValue >>= aValues)) throw IllegalArgumentException(); - const PropertyValue* valueEnd = aValues.getConstArray() + aValues.getLength(); - const PropertyValue* checkName = aValues.getConstArray(); - for ( ;checkName != valueEnd; ++checkName ) + for ( auto const & checkName : aValues ) { - if ( checkName->Name.isEmpty() ) + if ( checkName.Name.isEmpty() ) throw IllegalArgumentException(); } @@ -773,7 +771,7 @@ sal_Bool ODatabaseSource::convertFastPropertyValue(Any & rConvertedValue, Any & { const PropertyValue* pInfoIter = aSettings.getConstArray(); const PropertyValue* checkValue = aValues.getConstArray(); - for ( ;!bModified && checkValue != valueEnd ; ++checkValue,++pInfoIter) + for ( ;!bModified && checkValue != aValues.end() ; ++checkValue,++pInfoIter) { bModified = checkValue->Name != pInfoIter->Name; if ( !bModified ) @@ -824,8 +822,8 @@ namespace typedef std::set< OUString > StringSet; StringSet aToBeSetPropertyNames; std::transform( - _rAllNewPropertyValues.getConstArray(), - _rAllNewPropertyValues.getConstArray() + _rAllNewPropertyValues.getLength(), + _rAllNewPropertyValues.begin(), + _rAllNewPropertyValues.end(), std::insert_iterator< StringSet >( aToBeSetPropertyNames, aToBeSetPropertyNames.end() ), SelectPropertyName() ); @@ -839,19 +837,17 @@ namespace Reference< XPropertyState > xPropertyState( _rxPropertyBag, UNO_QUERY_THROW ); // loop through them, and reset resp. default properties which are not to be set - const Property* pExistentProperty( aAllExistentProperties.getConstArray() ); - const Property* pExistentPropertyEnd( aAllExistentProperties.getConstArray() + aAllExistentProperties.getLength() ); - for ( ; pExistentProperty != pExistentPropertyEnd; ++pExistentProperty ) + for ( auto const & existentProperty : aAllExistentProperties ) { - if ( aToBeSetPropertyNames.find( pExistentProperty->Name ) != aToBeSetPropertyNames.end() ) + if ( aToBeSetPropertyNames.find( existentProperty.Name ) != aToBeSetPropertyNames.end() ) continue; // this property is not to be set, but currently exists in the bag. // -> Remove it, or reset it to the default. - if ( ( pExistentProperty->Attributes & PropertyAttribute::REMOVABLE ) != 0 ) - _rxPropertyBag->removeProperty( pExistentProperty->Name ); + if ( ( existentProperty.Attributes & PropertyAttribute::REMOVABLE ) != 0 ) + _rxPropertyBag->removeProperty( existentProperty.Name ); else - xPropertyState->setPropertyToDefault( pExistentProperty->Name ); + xPropertyState->setPropertyToDefault( existentProperty.Name ); } // finally, set the new property values @@ -944,12 +940,9 @@ void ODatabaseSource::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) con Reference< XPropertySetInfo > xPST( xSettingsAsProps->getPropertySetInfo(), UNO_QUERY_THROW ); Sequence< Property > aSettings( xPST->getProperties() ); std::map< OUString, sal_Int32 > aPropertyAttributes; - for ( const Property* pSettings = aSettings.getConstArray(); - pSettings != aSettings.getConstArray() + aSettings.getLength(); - ++pSettings - ) + for ( auto const & setting : aSettings ) { - aPropertyAttributes[ pSettings->Name ] = pSettings->Attributes; + aPropertyAttributes[ setting.Name ] = setting.Attributes; } // get all current settings with their values @@ -959,8 +952,8 @@ void ODatabaseSource::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) con // criteria survive Sequence< PropertyValue > aNonDefaultOrUserDefined( aValues.getLength() ); const PropertyValue* pCopyEnd = std::remove_copy_if( - aValues.getConstArray(), - aValues.getConstArray() + aValues.getLength(), + aValues.begin(), + aValues.end(), aNonDefaultOrUserDefined.getArray(), IsDefaultAndNotRemoveable( aPropertyAttributes ) ); diff --git a/dbaccess/source/core/misc/ContainerMediator.cxx b/dbaccess/source/core/misc/ContainerMediator.cxx index a803a7d87b68..adde1ade5b3a 100644 --- a/dbaccess/source/core/misc/ContainerMediator.cxx +++ b/dbaccess/source/core/misc/ContainerMediator.cxx @@ -211,16 +211,14 @@ void OContainerMediator::notifyElementCreated( const OUString& _sName, const Ref // collect the to-be-monitored properties Reference< XPropertySetInfo > xPSI( _xDest->getPropertySetInfo(), UNO_QUERY_THROW ); Sequence< Property > aProperties( xPSI->getProperties() ); - const Property* property = aProperties.getConstArray(); - const Property* propertyEnd = aProperties.getConstArray() + aProperties.getLength(); - for ( ; property != propertyEnd; ++property ) + for ( auto const & property : aProperties ) { - if ( ( property->Attributes & PropertyAttribute::READONLY ) != 0 ) + if ( ( property.Attributes & PropertyAttribute::READONLY ) != 0 ) continue; - if ( ( property->Attributes & PropertyAttribute::BOUND ) == 0 ) + if ( ( property.Attributes & PropertyAttribute::BOUND ) == 0 ) continue; - aPropertyList.push_back( property->Name ); + aPropertyList.push_back( property.Name ); } } catch( const Exception& ) diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index ef6345f0b024..aaca4ecd9cd3 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -711,8 +711,8 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor { aColumns.resize( aRowSetColumnNames.getLength() ); std::transform( - aRowSetColumnNames.getConstArray(), - aRowSetColumnNames.getConstArray() + aRowSetColumnNames.getLength(), + aRowSetColumnNames.begin(), + aRowSetColumnNames.end(), aColumns.begin(), CreateColumnDescription() ); diff --git a/dbaccess/source/core/recovery/dbdocrecovery.cxx b/dbaccess/source/core/recovery/dbdocrecovery.cxx index 31068a852ad7..62407e4df00f 100644 --- a/dbaccess/source/core/recovery/dbdocrecovery.cxx +++ b/dbaccess/source/core/recovery/dbdocrecovery.cxx @@ -250,11 +250,9 @@ namespace dbaccess Reference< XDatabaseDocumentUI > xDatabaseUI( *ctrl, UNO_QUERY_THROW ); Sequence< Reference< XComponent > > aComponents( xDatabaseUI->getSubComponents() ); - const Reference< XComponent >* component = aComponents.getConstArray(); - const Reference< XComponent >* componentEnd = aComponents.getConstArray() + aComponents.getLength(); - for ( ; component != componentEnd; ++component ) + for ( auto const & component : aComponents ) { - SubComponentRecovery aComponentRecovery( m_pData->aContext, xDatabaseUI, *component ); + SubComponentRecovery aComponentRecovery( m_pData->aContext, xDatabaseUI, component ); aComponentRecovery.saveToRecoveryStorage( xRecoveryStorage, aMapCompDescs ); } } diff --git a/dbaccess/source/ext/macromigration/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx index 2ef661e0ce08..cd1477fcc1a2 100644 --- a/dbaccess/source/ext/macromigration/migrationengine.cxx +++ b/dbaccess/source/ext/macromigration/migrationengine.cxx @@ -675,8 +675,8 @@ namespace dbmm std::set< OUString > aNames; std::copy( - aElementNames.getConstArray(), - aElementNames.getConstArray() + aElementNames.getLength(), + aElementNames.begin(), + aElementNames.end(), std::insert_iterator< std::set< OUString > >( aNames, aNames.end() ) ); return aNames; @@ -971,13 +971,10 @@ namespace dbmm OUString( _rContainerLoc + "/" ) ); Sequence< OUString > aElementNames( _rxContainer->getElementNames() ); - for ( const OUString* elementName = aElementNames.getConstArray(); - elementName != aElementNames.getConstArray() + aElementNames.getLength(); - ++elementName - ) + for ( auto const & elementName : aElementNames ) { - Any aElement( _rxContainer->getByName( *elementName ) ); - OUString sElementName( sHierarhicalBase + *elementName ); + Any aElement( _rxContainer->getByName( elementName ) ); + OUString sElementName( sHierarhicalBase + elementName ); Reference< XNameAccess > xSubContainer( aElement, UNO_QUERY ); if ( xSubContainer.is() ) @@ -1439,12 +1436,9 @@ namespace dbmm Reference< XNameContainer > xTargetLib( xTargetLibraries->createLibrary( sNewLibName ), UNO_QUERY_THROW ); Sequence< OUString > aLibElementNames( xSourceLib->getElementNames() ); - for ( const OUString* pSourceElementName = aLibElementNames.getConstArray(); - pSourceElementName != aLibElementNames.getConstArray() + aLibElementNames.getLength(); - ++pSourceElementName - ) + for ( auto const & sourceElementName : aLibElementNames ) { - Any aElement = xSourceLib->getByName( *pSourceElementName ); + Any aElement = xSourceLib->getByName( sourceElementName ); OSL_ENSURE( aElement.hasValue(), "MigrationEngine_Impl::impl_migrateContainerLibraries_nothrow: invalid (empty) lib element!" ); @@ -1452,10 +1446,10 @@ namespace dbmm if ( _eScriptType == eDialog ) { impl_adjustDialogEvents_nothrow( aElement, lcl_getSubDocumentDescription( _rDocument ), - *pSourceLibName, *pSourceElementName ); + *pSourceLibName, sourceElementName ); } - xTargetLib->insertByName( *pSourceElementName, aElement ); + xTargetLib->insertByName( sourceElementName, aElement ); } // transfer the read-only flag @@ -1640,12 +1634,9 @@ namespace dbmm Sequence< OUString > aEventNames = xEvents->getElementNames(); Any aEvent; - for ( const OUString* eventName = aEventNames.getConstArray(); - eventName != aEventNames.getConstArray() + aEventNames.getLength(); - ++eventName - ) + for ( auto const & eventName : aEventNames ) { - aEvent = xEvents->getByName( *eventName ); + aEvent = xEvents->getByName( eventName ); if ( !aEvent.hasValue() ) continue; @@ -1654,7 +1645,7 @@ namespace dbmm continue; // put back - xEvents->replaceByName( *eventName, aEvent ); + xEvents->replaceByName( eventName, aEvent ); } } catch( const Exception& ) diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 5df2a564d76c..547a9a012872 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -265,8 +265,8 @@ Sequence< Type > SAL_CALL SbaTableQueryBrowser::getTypes( ) { Sequence< Type > aStrippedTypes( aTypes.getLength() - 1 ); std::remove_copy_if( - aTypes.getConstArray(), - aTypes.getConstArray() + aTypes.getLength(), + aTypes.begin(), + aTypes.end(), aStrippedTypes.getArray(), std::bind2nd( std::equal_to< Type >(), cppu::UnoType<XScriptInvocationContext>::get() ) ); diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index c42ba713a3ea..6cdab2604fde 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -188,9 +188,7 @@ namespace { OTableTreeListBox::TNames::value_type aRet; aRet.first = name; - const OUString* pIter = m_aViews.getConstArray(); - const OUString* pEnd = m_aViews.getConstArray() + m_aViews.getLength(); - aRet.second = std::any_of(pIter, pEnd, + aRet.second = std::any_of(m_aViews.begin(), m_aViews.end(), [this, &name](const OUString& lhs) { return m_aEqualFunctor(lhs, name); } ); @@ -208,12 +206,10 @@ void OTableTreeListBox::UpdateTableList( { TNames aTables; aTables.resize(_rTables.getLength()); - const OUString* pIter = _rTables.getConstArray(); - const OUString* pEnd = _rTables.getConstArray() + _rTables.getLength(); try { Reference< XDatabaseMetaData > xMeta( _rxConnection->getMetaData(), UNO_QUERY_THROW ); - std::transform( pIter, pEnd, + std::transform( _rTables.begin(), _rTables.end(), aTables.begin(), OViewSetter( _rViews, xMeta->supportsMixedCaseQuotedIdentifiers() ) ); } catch(Exception&) diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index 2a80aefc3efa..8415d002f48e 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -289,10 +289,8 @@ void QueryListFacade::updateTableObjectList( bool /*_bAllowViews*/ ) } Sequence< OUString > aQueryNames = xQueries->getElementNames(); - const OUString* pQuery = aQueryNames.getConstArray(); - const OUString* pQueryEnd = aQueryNames.getConstArray() + aQueryNames.getLength(); - while ( pQuery != pQueryEnd ) - m_rQueryList.InsertEntry( *pQuery++ ); + for ( auto const & name : aQueryNames ) + m_rQueryList.InsertEntry( name ); } catch( const Exception& ) { diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index d1a1845ddc56..eefea14eebe9 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1034,17 +1034,17 @@ void fillAutoIncrementValue(const Reference<XPropertySet>& _xDatasource, _xDatasource->getPropertyValue(PROPERTY_INFO) >>= aInfo; // search the right propertyvalue - const PropertyValue* pValue =std::find_if(aInfo.getConstArray(), aInfo.getConstArray() + aInfo.getLength(), + const PropertyValue* pValue =std::find_if(aInfo.begin(), aInfo.end(), [](const PropertyValue& lhs) {return TPropertyValueEqualFunctor()(lhs, PROPERTY_AUTOINCREMENTCREATION);} ); - if ( pValue && pValue != (aInfo.getConstArray() + aInfo.getLength()) ) + if ( pValue && pValue != aInfo.end() ) pValue->Value >>= _rsAutoIncrementValue; - pValue =std::find_if(aInfo.getConstArray(), aInfo.getConstArray() + aInfo.getLength(), + pValue =std::find_if(aInfo.begin(), aInfo.end(), [](const PropertyValue& lhs) {return TPropertyValueEqualFunctor()(lhs, "IsAutoRetrievingEnabled");} ); - if ( pValue && pValue != (aInfo.getConstArray() + aInfo.getLength()) ) + if ( pValue && pValue != aInfo.end() ) pValue->Value >>= _rAutoIncrementValueEnabled; } } diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx index 82a5d90e8e7f..87d5be71f7c2 100644 --- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx +++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx @@ -228,8 +228,8 @@ namespace dbaui { Sequence< Type > aStrippedTypes( aTypes.getLength() - 1 ); std::remove_copy_if( - aTypes.getConstArray(), - aTypes.getConstArray() + aTypes.getLength(), + aTypes.begin(), + aTypes.end(), aStrippedTypes.getArray(), std::bind2nd( std::equal_to< Type >(), cppu::UnoType<XScriptInvocationContext>::get() ) ); diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx index 4e8da229b874..2d4f378a6211 100644 --- a/dbaccess/source/ui/misc/dsmeta.cxx +++ b/dbaccess/source/ui/misc/dsmeta.cxx @@ -92,13 +92,10 @@ namespace dbaui { ::connectivity::DriversConfig aDriverConfig( ::comphelper::getProcessComponentContext() ); const uno::Sequence< OUString > aPatterns = aDriverConfig.getURLs(); - for ( const OUString* pattern = aPatterns.getConstArray(); - pattern != aPatterns.getConstArray() + aPatterns.getLength(); - ++pattern - ) + for ( auto const & pattern : aPatterns ) { FeatureSet aCurrentSet; - const ::comphelper::NamedValueCollection aCurrentFeatures( aDriverConfig.getFeatures( *pattern ).getNamedValues() ); + const ::comphelper::NamedValueCollection aCurrentFeatures( aDriverConfig.getFeatures( pattern ).getNamedValues() ); const FeatureMapping* pFeatureMapping = lcl_getFeatureMappings(); while ( pFeatureMapping->pAsciiFeatureName ) @@ -108,7 +105,7 @@ namespace dbaui ++pFeatureMapping; } - s_aFeatureSets[ *pattern ] = aCurrentSet; + s_aFeatureSets[ pattern ] = aCurrentSet; } } diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 25e61b4bfbd8..6cce6ebd7c9a 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -3076,13 +3076,10 @@ void OQueryDesignView::initByFieldDescriptions( const Sequence< PropertyValue >& m_pSelectionBox->SetReadOnly( rController.isReadOnly() ); m_pSelectionBox->Fill(); - for ( const PropertyValue* field = i_rFieldDescriptions.getConstArray(); - field != i_rFieldDescriptions.getConstArray() + i_rFieldDescriptions.getLength(); - ++field - ) + for ( auto const & field : i_rFieldDescriptions ) { ::rtl::Reference< OTableFieldDesc > pField( new OTableFieldDesc() ); - pField->Load( *field, true ); + pField->Load( field, true ); InsertField( pField, false ); } diff --git a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx index bcde5918a1f7..44ead8996757 100644 --- a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx +++ b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx @@ -151,8 +151,8 @@ void OTableFieldDesc::Load( const css::beans::PropertyValue& i_rSettings, const const Sequence< PropertyValue > aCriteria( aFieldDesc.getOrDefault( "Criteria", Sequence< PropertyValue >() ) ); m_aCriteria.resize( aCriteria.getLength() ); std::transform( - aCriteria.getConstArray(), - aCriteria.getConstArray() + aCriteria.getLength(), + aCriteria.begin(), + aCriteria.end(), m_aCriteria.begin(), SelectPropertyValueAsString() ); diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 91aae8d61b3c..1f7647c1d994 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -398,8 +398,8 @@ void SAL_CALL OQueryController::getFastPropertyValue( Any& o_rValue, sal_Int32 i ); std::sort( - aProps.getArray(), - aProps.getArray() + aProps.getLength(), + aProps.begin(), + aProps.end(), ::comphelper::PropertyCompareByName() ); |