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/source/ui | |
parent | 13341ffa49d58f313a05edae4f4f04c215658e9f (diff) |
use more begin()/end() for Sequence
Change-Id: I399be6b6ef7a6ce01e883569a177c0969bc29c69
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r-- | dbaccess/source/ui/browser/unodatbr.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/control/tabletree.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/adtabdlg.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/UITools.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/dsmeta.cxx | 9 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/QueryDesignView.cxx | 7 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/TableFieldDescription.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/querycontroller.cxx | 4 |
9 files changed, 21 insertions, 33 deletions
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() ); |