diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-10-09 12:32:14 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-12-03 15:47:25 +0100 |
commit | 2dfcbfbdde1ab25bf395bf8f4533965f7d99d9e3 (patch) | |
tree | eb27797ec02628007a203c18590d4df485761ed3 /basctl | |
parent | 6c3ff6323e1bfd7f9ca676b2edb2647699ed405f (diff) |
Use std::initializer_list
Change-Id: I726fc6429a2eb7827d09d04584fd0b725e78f650
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/bastype2.cxx | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index 05894ade15b2..9a4d75e5e2b5 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -41,6 +41,7 @@ #include <sfx2/dispatch.hxx> #include <cassert> +#include <initializer_list> #include <memory> #include <com/sun/star/script/ModuleType.hpp> @@ -424,18 +425,15 @@ void TreeListBox::ImpCreateLibSubEntries( SvTreeListEntry* pLibRootEntry, const void TreeListBox::ImpCreateLibSubEntriesInVBAMode( SvTreeListEntry* pLibRootEntry, const ScriptDocument& rDocument, const OUString& rLibName ) { - - std::vector<std::pair<EntryType, OUString> > aEntries; - aEntries.push_back( ::std::make_pair( OBJ_TYPE_DOCUMENT_OBJECTS, IDE_RESSTR(RID_STR_DOCUMENT_OBJECTS) ) ); - aEntries.push_back( ::std::make_pair( OBJ_TYPE_USERFORMS, IDE_RESSTR(RID_STR_USERFORMS) ) ); - aEntries.push_back( ::std::make_pair( OBJ_TYPE_NORMAL_MODULES, IDE_RESSTR(RID_STR_NORMAL_MODULES) ) ); - aEntries.push_back( ::std::make_pair( OBJ_TYPE_CLASS_MODULES, IDE_RESSTR(RID_STR_CLASS_MODULES) ) ); - - std::vector<std::pair<EntryType, OUString> >::iterator iter; - for( iter = aEntries.begin(); iter != aEntries.end(); ++iter ) + auto const aEntries = { + std::make_pair( OBJ_TYPE_DOCUMENT_OBJECTS, IDE_RESSTR(RID_STR_DOCUMENT_OBJECTS) ), + std::make_pair( OBJ_TYPE_USERFORMS, IDE_RESSTR(RID_STR_USERFORMS) ), + std::make_pair( OBJ_TYPE_NORMAL_MODULES, IDE_RESSTR(RID_STR_NORMAL_MODULES) ), + std::make_pair( OBJ_TYPE_CLASS_MODULES, IDE_RESSTR(RID_STR_CLASS_MODULES) ) }; + for( auto const & iter: aEntries ) { - EntryType eType = iter->first; - OUString aEntryName = iter->second; + EntryType eType = iter.first; + OUString const & aEntryName = iter.second; SvTreeListEntry* pLibSubRootEntry = FindEntry( pLibRootEntry, aEntryName, eType ); if( pLibSubRootEntry ) { |