diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-10 16:12:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 12:50:55 +0200 |
commit | 20571c472528c4f98fe3f55700d134915d32a49a (patch) | |
tree | 9b350824d845b8aaeb13d087ef74febb454b821b /UnoControls | |
parent | b401896a56149aa2871b65a330a6f601a9830ccd (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 'UnoControls')
-rw-r--r-- | UnoControls/source/base/basecontainercontrol.cxx | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/UnoControls/source/base/basecontainercontrol.cxx b/UnoControls/source/base/basecontainercontrol.cxx index 766b5fa75e6d..2a34e16d1fa1 100644 --- a/UnoControls/source/base/basecontainercontrol.cxx +++ b/UnoControls/source/base/basecontainercontrol.cxx @@ -166,21 +166,15 @@ void SAL_CALL BaseContainerControl::dispose() // remove controls Sequence< Reference< XControl > > seqCtrls = getControls(); - Reference< XControl > * pCtrls = seqCtrls.getArray(); - sal_uInt32 nCtrls = seqCtrls.getLength(); - size_t nMaxCount = maControlInfoList.size(); - size_t nCount = 0; - for ( nCount = 0; nCount < nMaxCount; ++nCount ) - { - delete maControlInfoList[ nCount ]; - } + for ( auto & i : maControlInfoList ) + delete i; maControlInfoList.clear(); - for ( nCount = 0; nCount < nCtrls; ++nCount ) + for ( Reference< XControl > const & control : seqCtrls ) { - pCtrls [ nCount ] -> removeEventListener ( static_cast< XEventListener* >( static_cast< XWindowListener* >( this ) ) ); - pCtrls [ nCount ] -> dispose ( ); + control->removeEventListener ( static_cast< XEventListener* >( static_cast< XWindowListener* >( this ) ) ); + control->dispose ( ); } // call baseclass |