From a12dfa353122d1865b7c20513865a4632a621a38 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 30 Apr 2017 19:50:49 +0200 Subject: create SfxGroupId based on o3tl::strong_int Change-Id: Iaccf16f29b6f4b1a2c712d1e5e2bd0fa4fdb5e71 Reviewed-on: https://gerrit.libreoffice.org/37108 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sfx2/source/control/msgpool.cxx | 2 +- sfx2/source/control/shell.cxx | 2 +- sfx2/source/view/sfxbasecontroller.cxx | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx index ed74d2020c3b..e0de09b8d548 100644 --- a/sfx2/source/control/msgpool.cxx +++ b/sfx2/source/control/msgpool.cxx @@ -143,7 +143,7 @@ OUString SfxSlotPool::SeekGroup( sal_uInt16 nNo ) } } - SfxResId aResId( _vGroups[_nCurGroup] ); + SfxResId aResId( (sal_uInt16)_vGroups[_nCurGroup] ); aResId.SetRT(RSC_STRING); if ( !SfxResId::GetResMgr()->IsAvailable(aResId) ) { diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index 13b3be168c07..4fa297d02010 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -537,7 +537,7 @@ void SfxShell::SetVerbs(const css::uno::Sequence < css::embed::VerbDescriptor >& SfxSlot *pNewSlot = new SfxSlot; pNewSlot->nSlotId = nSlotId; - pNewSlot->nGroupId = 0; + pNewSlot->nGroupId = SfxGroupId(0); // Verb slots must be executed asynchronously, so that they can be // destroyed while executing. diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index bb03b8ddf036..b7947d3dc648 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -108,7 +108,7 @@ using ::com::sun::star::ui::XSidebarProvider; struct GroupIDToCommandGroup { - sal_Int16 nGroupID; + SfxGroupId nGroupID; sal_Int16 nCommandGroup; }; @@ -141,19 +141,19 @@ static const GroupIDToCommandGroup GroupIDCommandGroupMap[] = { GID_MODIFY , frame::CommandGroup::MODIFY }, { GID_DRAWING , frame::CommandGroup::DRAWING }, { GID_CONTROLS , frame::CommandGroup::CONTROLS }, - { 0 , 0 } + { SfxGroupId(0) , 0 } }; -typedef std::unordered_map< sal_Int16, sal_Int16 > GroupHashMap; +typedef std::unordered_map< SfxGroupId, sal_Int16 > GroupHashMap; -sal_Int16 MapGroupIDToCommandGroup( sal_Int16 nGroupID ) +sal_Int16 MapGroupIDToCommandGroup( SfxGroupId nGroupID ) { static GroupHashMap s_aHashMap; if ( !bGroupIDMapInitialized ) { sal_Int32 i = 0; - while ( GroupIDCommandGroupMap[i].nGroupID != 0 ) + while ( GroupIDCommandGroupMap[i].nGroupID != SfxGroupId(0) ) { s_aHashMap.insert( GroupHashMap::value_type( GroupIDCommandGroupMap[i].nGroupID, -- cgit v1.2.3