summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-05 13:27:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-06 08:35:23 +0200
commitab9b38a4064141705aa3a3de9a5d73b465ad3af3 (patch)
tree888fcc6b517c44d77e2d297c13ee84fb487dd7a7 /toolkit
parent13341ffa49d58f313a05edae4f4f04c215658e9f (diff)
use more begin()/end() for Sequence
Change-Id: I399be6b6ef7a6ce01e883569a177c0969bc29c69
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxwindows.cxx6
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx6
-rw-r--r--toolkit/source/controls/formattedcontrol.cxx9
-rw-r--r--toolkit/source/controls/geometrycontrolmodel.cxx8
-rw-r--r--toolkit/source/controls/unocontrol.cxx7
-rw-r--r--toolkit/source/controls/unocontrols.cxx12
6 files changed, 19 insertions, 29 deletions
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 9abc5eca60ab..2cab3bd553e4 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -1556,9 +1556,7 @@ void VCLXListBox::addItems( const css::uno::Sequence< OUString>& aItems, sal_Int
if ( pBox )
{
sal_uInt16 nP = nPos;
- const OUString* pItems = aItems.getConstArray();
- const OUString* pItemsEnd = aItems.getConstArray() + aItems.getLength();
- while ( pItems != pItemsEnd )
+ for ( auto const & item : aItems )
{
if ( nP == 0xFFFF )
{
@@ -1567,7 +1565,7 @@ void VCLXListBox::addItems( const css::uno::Sequence< OUString>& aItems, sal_Int
break;
}
- pBox->InsertEntry( *pItems++, nP++ );
+ pBox->InsertEntry( item, nP++ );
}
}
}
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index dadeeac23c6d..2a26fdf76b79 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -670,18 +670,16 @@ void SAL_CALL ControlModelContainerBase::setControlModels( const Sequence< Refer
SolarMutexGuard aGuard;
// set the tab indexes according to the order of models in the sequence
- const Reference< XControlModel >* pControls = _rControls.getConstArray( );
- const Reference< XControlModel >* pControlsEnd = _rControls.getConstArray( ) + _rControls.getLength();
sal_Int16 nTabIndex = 1;
- for ( ; pControls != pControlsEnd; ++pControls )
+ for ( auto const & control : _rControls )
{
// look up the control in our own structure. This is to prevent invalid arguments
UnoControlModelHolderList::const_iterator aPos =
::std::find_if(
maModels.begin(), maModels.end(),
- CompareControlModel( *pControls )
+ CompareControlModel( control )
);
if ( maModels.end() != aPos )
{
diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx
index 69d1b1c056da..2cf0557fe015 100644
--- a/toolkit/source/controls/formattedcontrol.cxx
+++ b/toolkit/source/controls/formattedcontrol.cxx
@@ -307,15 +307,12 @@ namespace toolkit
{
bool bSettingValue = false;
bool bSettingText = false;
- for ( const OUString* pPropertyNames = _rPropertyNames.getConstArray();
- pPropertyNames != _rPropertyNames.getConstArray() + _rPropertyNames.getLength();
- ++pPropertyNames
- )
+ for ( auto const & propertyName : _rPropertyNames )
{
- if ( BASEPROPERTY_EFFECTIVE_VALUE == GetPropertyId( *pPropertyNames ) )
+ if ( BASEPROPERTY_EFFECTIVE_VALUE == GetPropertyId( propertyName ) )
bSettingValue = true;
- if ( BASEPROPERTY_TEXT == GetPropertyId( *pPropertyNames ) )
+ if ( BASEPROPERTY_TEXT == GetPropertyId( propertyName ) )
bSettingText = true;
}
diff --git a/toolkit/source/controls/geometrycontrolmodel.cxx b/toolkit/source/controls/geometrycontrolmodel.cxx
index e7824d416f5c..7a541cafa0a6 100644
--- a/toolkit/source/controls/geometrycontrolmodel.cxx
+++ b/toolkit/source/controls/geometrycontrolmodel.cxx
@@ -157,8 +157,8 @@
sal_Int32 nOldSize = aTypes.getLength();
aTypes.realloc( nOldSize + aAggTypes.getLength() );
::std::copy(
- aAggTypes.getConstArray(),
- aAggTypes.getConstArray() + aAggTypes.getLength(),
+ aAggTypes.begin(),
+ aAggTypes.end(),
aTypes.getArray() + nOldSize
);
}
@@ -531,8 +531,8 @@
IntArrayArray::value_type& rDuplicateIds = AmbiguousPropertyIds::get()[ _nId ];
// for this, sort the aggregate properties
::std::sort(
- aAggregateProps.getArray(),
- aAggregateProps.getArray() + aAggregateProps.getLength(),
+ aAggregateProps.begin(),
+ aAggregateProps.end(),
PropertyNameLess()
);
const Property* pAggProps = aAggregateProps.getConstArray();
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index 3233f71081c2..42c33c0d27eb 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -454,11 +454,8 @@ void UnoControl::ImplLockPropertyChangeNotification( const OUString& rPropertyNa
void UnoControl::ImplLockPropertyChangeNotifications( const Sequence< OUString >& rPropertyNames, bool bLock )
{
- for ( const OUString* pPropertyName = rPropertyNames.getConstArray();
- pPropertyName != rPropertyNames.getConstArray() + rPropertyNames.getLength();
- ++pPropertyName
- )
- ImplLockPropertyChangeNotification( *pPropertyName, bLock );
+ for ( auto const & propertyName : rPropertyNames )
+ ImplLockPropertyChangeNotification( propertyName, bLock );
}
void UnoControl::ImplModelPropertiesChanged( const Sequence< PropertyChangeEvent >& rEvents )
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index a173d18afb39..89ab2d222520 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -2250,8 +2250,8 @@ void SAL_CALL UnoControlListBoxModel::setFastPropertyValue_NoBroadcast( sal_Int3
::std::vector< ListItem > aItems( aStringItemList.getLength() );
::std::transform(
- aStringItemList.getConstArray(),
- aStringItemList.getConstArray() + aStringItemList.getLength(),
+ aStringItemList.begin(),
+ aStringItemList.end(),
aItems.begin(),
CreateListItem()
);
@@ -2456,8 +2456,8 @@ void UnoControlListBoxModel::impl_getStringItemList( ::std::vector< OUString >&
o_rStringItems.resize( size_t( aStringItemList.getLength() ) );
::std::copy(
- aStringItemList.getConstArray(),
- aStringItemList.getConstArray() + aStringItemList.getLength(),
+ aStringItemList.begin(),
+ aStringItemList.end(),
o_rStringItems.begin()
);
}
@@ -3087,8 +3087,8 @@ void SAL_CALL UnoControlComboBoxModel::setFastPropertyValue_NoBroadcast( sal_Int
::std::vector< ListItem > aItems( aStringItemList.getLength() );
::std::transform(
- aStringItemList.getConstArray(),
- aStringItemList.getConstArray() + aStringItemList.getLength(),
+ aStringItemList.begin(),
+ aStringItemList.end(),
aItems.begin(),
CreateListItem()
);