summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-10-14 20:25:12 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-15 08:00:08 +0200
commit40ab4d8fda9b69b388ac674c1ee4e88084af9519 (patch)
tree4e793d89f6e5001cd8f43ead80ffa26a5798ac4e /vbahelper
parent9ec8bf8f22fe74884185492ef2576ce79b41e4f1 (diff)
Simplify containers iterations in unotools, unoxml, uui, vbahelper
Use range-based loop or replace with STL functions. Change-Id: I5a43f6fc62c81453dcef3820bb715f4da76915af Reviewed-on: https://gerrit.libreoffice.org/61762 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/source/vbahelper/vbacommandbarhelper.cxx11
-rw-r--r--vbahelper/source/vbahelper/vbaeventshelperbase.cxx4
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx7
3 files changed, 8 insertions, 14 deletions
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
index 058ddc2a4142..708b59a0da41 100644
--- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx
@@ -73,13 +73,10 @@ public:
OUString findBuildinToolbar( const OUString& sToolbarName )
{
- MSO2OOCommandbarMap::iterator it = maBuildinToolbarMap.begin();
- for(; it != maBuildinToolbarMap.end(); ++it )
- {
- OUString sName = it->first;
- if( sName.equalsIgnoreAsciiCase( sToolbarName ) )
- return it->second;
- }
+ auto it = std::find_if(maBuildinToolbarMap.begin(), maBuildinToolbarMap.end(),
+ [&sToolbarName](const MSO2OOCommandbarMap::value_type& rItem) { return rItem.first.equalsIgnoreAsciiCase( sToolbarName ); });
+ if( it != maBuildinToolbarMap.end() )
+ return it->second;
return OUString();
}
};
diff --git a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
index cf30602f5e3c..99d49625c3e9 100644
--- a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
+++ b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
@@ -344,9 +344,9 @@ VbaEventsHelperBase::ModulePathMap& VbaEventsHelperBase::updateModulePathMap( co
sal_Int32 nModuleType = getModuleType( rModuleName );
// search for all event handlers
ModulePathMap& rPathMap = maEventPaths[ rModuleName ];
- for( EventHandlerInfoMap::iterator aIt = maEventInfos.begin(), aEnd = maEventInfos.end(); aIt != aEnd; ++aIt )
+ for( const auto& rEventInfo : maEventInfos )
{
- const EventHandlerInfo& rInfo = aIt->second;
+ const EventHandlerInfo& rInfo = rEventInfo.second;
if( rInfo.mnModuleType == nModuleType )
rPathMap[ rInfo.mnEventId ] = resolveVBAMacro( mpShell, maLibraryName, rModuleName, rInfo.maMacroName );
}
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index 4ebc80e743c4..e1a148274604 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -724,12 +724,9 @@ void setCursorHelper( const uno::Reference< frame::XModel >& xModel, const Point
}
}
- for ( ::std::vector< uno::Reference< frame::XController > >::const_iterator controller = aControllers.begin();
- controller != aControllers.end();
- ++controller
- )
+ for ( const auto& rController : aControllers )
{
- const uno::Reference< frame::XFrame > xFrame ( (*controller)->getFrame(), uno::UNO_SET_THROW );
+ const uno::Reference< frame::XFrame > xFrame ( rController->getFrame(), uno::UNO_SET_THROW );
const uno::Reference< awt::XWindow > xWindow ( xFrame->getContainerWindow(), uno::UNO_SET_THROW );
VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xWindow );