diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-15 09:56:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-15 14:00:48 +0200 |
commit | 898cbb22f07a2c1487700326f134fe54e7a13f4d (patch) | |
tree | d5bdd749ca565f74976653c7cac90e1eaecc74d6 /basctl | |
parent | 10cdeed12ef834f5df3b6577c1d9efcc811d6938 (diff) |
use for-range on Sequence in basctl..canvas
Change-Id: Idad3d8fbe785c7b1b8b287a3227372adb2757de8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94260
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 18 | ||||
-rw-r--r-- | basctl/source/dlged/dlgedclip.cxx | 4 |
2 files changed, 8 insertions, 14 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index a722b802a55c..2d500c4d2ca4 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -2835,13 +2835,10 @@ std::vector< OUString > UnoTypeCodeCompletetor::GetXIdlClassMethods() const std::vector< OUString > aRetVect; if( bCanComplete && ( xClass != nullptr ) ) { - Sequence< Reference< reflection::XIdlMethod > > aMethods = xClass->getMethods(); - if( aMethods.hasElements() ) + const Sequence< Reference< reflection::XIdlMethod > > aMethods = xClass->getMethods(); + for(Reference< reflection::XIdlMethod > const & rMethod : aMethods) { - for(sal_Int32 l = 0; l < aMethods.getLength(); ++l) - { - aRetVect.push_back( aMethods[l]->getName() ); - } + aRetVect.push_back( rMethod->getName() ); } } return aRetVect;//this is empty when cannot code complete @@ -2852,13 +2849,10 @@ std::vector< OUString > UnoTypeCodeCompletetor::GetXIdlClassFields() const std::vector< OUString > aRetVect; if( bCanComplete && ( xClass != nullptr ) ) { - Sequence< Reference< reflection::XIdlField > > aFields = xClass->getFields(); - if( aFields.hasElements() ) + const Sequence< Reference< reflection::XIdlField > > aFields = xClass->getFields(); + for(Reference< reflection::XIdlField > const & rxField : aFields) { - for(sal_Int32 l = 0; l < aFields.getLength(); ++l) - { - aRetVect.push_back( aFields[l]->getName() ); - } + aRetVect.push_back( rxField->getName() ); } } return aRetVect;//this is empty when cannot code complete diff --git a/basctl/source/dlged/dlgedclip.cxx b/basctl/source/dlged/dlgedclip.cxx index bb9787e4f5e6..931f10afe507 100644 --- a/basctl/source/dlged/dlgedclip.cxx +++ b/basctl/source/dlged/dlgedclip.cxx @@ -90,8 +90,8 @@ sal_Bool SAL_CALL DlgEdTransferableImpl::isDataFlavorSupported( const DataFlavor { const SolarMutexGuard aGuard; - for ( sal_Int32 i = 0; i < m_SeqFlavors.getLength(); i++ ) - if ( compareDataFlavors( m_SeqFlavors[i] , rFlavor ) ) + for ( auto const & i : std::as_const(m_SeqFlavors) ) + if ( compareDataFlavors( i, rFlavor ) ) return true; return false; } |