diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-07-27 23:20:29 +0300 |
---|---|---|
committer | Arkadiy Illarionov <qarkai@gmail.com> | 2019-07-30 11:16:00 +0200 |
commit | 5ba84c3c7080d55d86b8b39db077b6da36cb700a (patch) | |
tree | a71491f3d336a314ab63e834bd013f0503be967b /scripting/source/dlgprov | |
parent | 850693273970be2662cce8f4d2710b3657a02f65 (diff) |
Simplify Sequence iterations in scaddins, sccomp, scripting
Use range-based loops, STL and comphelper functions
Change-Id: I836422a1c81a3dc9585687ed2e506eb59bb4ec91
Reviewed-on: https://gerrit.libreoffice.org/76484
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'scripting/source/dlgprov')
-rw-r--r-- | scripting/source/dlgprov/dlgevtatt.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/scripting/source/dlgprov/dlgevtatt.cxx b/scripting/source/dlgprov/dlgevtatt.cxx index 2bdcf0d2cfba..691b12ca757b 100644 --- a/scripting/source/dlgprov/dlgevtatt.cxx +++ b/scripting/source/dlgprov/dlgevtatt.cxx @@ -221,14 +221,12 @@ namespace dlgprov if ( xEventCont.is() ) { Sequence< OUString > aNames = xEventCont->getElementNames(); - const OUString* pNames = aNames.getConstArray(); - sal_Int32 nNameCount = aNames.getLength(); - for ( sal_Int32 j = 0; j < nNameCount; ++j ) + for ( const OUString& rName : aNames ) { ScriptEventDescriptor aDesc; - Any aElement = xEventCont->getByName( pNames[ j ] ); + Any aElement = xEventCont->getByName( rName ); aElement >>= aDesc; OUString sKey = aDesc.ScriptType; if ( aDesc.ScriptType == "Script" || aDesc.ScriptType == "UNO" ) @@ -277,15 +275,12 @@ namespace dlgprov void DialogEventsAttacherImpl::nestedAttachEvents( const Sequence< Reference< XInterface > >& Objects, const Any& Helper, OUString& sDialogCodeName ) { - const Reference< XInterface >* pObjects = Objects.getConstArray(); - sal_Int32 nObjCount = Objects.getLength(); - - for ( sal_Int32 i = 0; i < nObjCount; ++i ) + for ( const Reference< XInterface >& rObject : Objects ) { // We know that we have to do with instances of XControl. // Otherwise this is not the right implementation for // XScriptEventsAttacher and we have to give up. - Reference< XControl > xControl( pObjects[ i ], UNO_QUERY ); + Reference< XControl > xControl( rObject, UNO_QUERY ); Reference< XControlContainer > xControlContainer( xControl, UNO_QUERY ); Reference< XDialog > xDialog( xControl, UNO_QUERY ); if ( !xControl.is() ) |