diff options
Diffstat (limited to 'forms/source/misc/InterfaceContainer.cxx')
-rw-r--r-- | forms/source/misc/InterfaceContainer.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index 6c4885260afb..3d5ffd73083b 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -81,11 +81,9 @@ namespace bool lcl_hasVbaEvents( const Sequence< ScriptEventDescriptor >& sEvents ) { - const ScriptEventDescriptor* pDesc = sEvents.getConstArray(); - const ScriptEventDescriptor* pEnd = ( pDesc + sEvents.getLength() ); - for ( ; pDesc != pEnd; ++pDesc ) + for ( auto const& rDesc : sEvents ) { - if ( pDesc->ScriptType == "VBAInterop" ) + if ( rDesc.ScriptType == "VBAInterop" ) return true; } return false; @@ -95,19 +93,17 @@ Sequence< ScriptEventDescriptor > lcl_stripVbaEvents( const Sequence< ScriptEventDescriptor >& sEvents ) { Sequence< ScriptEventDescriptor > sStripped( sEvents.getLength() ); + ScriptEventDescriptor* pStripped = sStripped.getArray(); - const ScriptEventDescriptor* pDesc = sEvents.getConstArray(); - const ScriptEventDescriptor* pEnd = ( pDesc + sEvents.getLength() ); sal_Int32 nCopied = 0; - for ( ; pDesc != pEnd; ++pDesc ) + for ( auto const& rDesc : sEvents ) { - if ( pDesc->ScriptType != "VBAInterop" ) + if ( rDesc.ScriptType != "VBAInterop" ) { - sStripped[ nCopied++ ] = *pDesc; + pStripped[ nCopied++ ] = rDesc; } } - if ( nCopied ) - sStripped.realloc( nCopied ); + sStripped.realloc( nCopied ); return sStripped; } |