From 1692998399eecb79e7b59456cff805bcb77aece4 Mon Sep 17 00:00:00 2001 From: Noel Date: Mon, 8 Mar 2021 21:37:43 +0200 Subject: use strong_int for item ids in vcl::ToolBox (*) fix bug in SfxToolBoxControl::StateChanged where it was using the slot id instead of the toolbox item id (*) I left the logic in SbaTableQueryBrowser alone, but it looks suspicious, casting slot ids to toolbox ids Change-Id: Ied229164c27fb4456b0515c6fdcbd1682766a1a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112186 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sd/source/ui/controller/displaymodecontroller.cxx | 4 ++-- sd/source/ui/controller/slidelayoutcontroller.cxx | 2 +- sd/source/ui/dlg/diactrl.cxx | 2 +- sd/source/ui/dlg/gluectrl.cxx | 2 +- sd/source/ui/inc/diactrl.hxx | 2 +- sd/source/ui/inc/gluectrl.hxx | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sd/source') diff --git a/sd/source/ui/controller/displaymodecontroller.cxx b/sd/source/ui/controller/displaymodecontroller.cxx index c48f5d635ce9..8dc1a743897b 100644 --- a/sd/source/ui/controller/displaymodecontroller.cxx +++ b/sd/source/ui/controller/displaymodecontroller.cxx @@ -199,7 +199,7 @@ void SAL_CALL DisplayModeController::initialize( const css::uno::Sequence< css:: { svt::PopupWindowController::initialize( aArguments ); ToolBox* pToolBox = nullptr; - sal_uInt16 nId = 0; + ToolBoxItemId nId; if ( getToolboxId( nId, &pToolBox ) ) pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWNONLY ); setToolboxItemImage(BMP_DISPLAYMODE_SLIDE); @@ -222,7 +222,7 @@ VclPtr DisplayModeController::createVclPopupWindow( vcl::Window* pP void DisplayModeController::setToolboxItemImage(const OUString& rImage) { - sal_uInt16 nId; + ToolBoxItemId nId; ToolBox* pToolBox = nullptr; if (!getToolboxId( nId, &pToolBox )) return; diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx index 284df02be296..1fcef5fa98de 100644 --- a/sd/source/ui/controller/slidelayoutcontroller.cxx +++ b/sd/source/ui/controller/slidelayoutcontroller.cxx @@ -317,7 +317,7 @@ void SAL_CALL SlideLayoutController::initialize( const css::uno::Sequence< css:: svt::PopupWindowController::initialize( aArguments ); ToolBox* pToolBox = nullptr; - sal_uInt16 nId = 0; + ToolBoxItemId nId; if ( getToolboxId( nId, &pToolBox ) ) { if ( mbInsertPage ) diff --git a/sd/source/ui/dlg/diactrl.cxx b/sd/source/ui/dlg/diactrl.cxx index aa4cff712d63..6dd4fb84516d 100644 --- a/sd/source/ui/dlg/diactrl.cxx +++ b/sd/source/ui/dlg/diactrl.cxx @@ -139,7 +139,7 @@ IMPL_LINK_NOARG(SdPagesField, ModifyHdl, weld::SpinButton&, void) aArgs ); } -SdTbxCtlDiaPages::SdTbxCtlDiaPages( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) : +SdTbxCtlDiaPages::SdTbxCtlDiaPages( sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx ) : SfxToolBoxControl( nSlotId, nId, rTbx ) { } diff --git a/sd/source/ui/dlg/gluectrl.cxx b/sd/source/ui/dlg/gluectrl.cxx index 8e4389dd8983..23e1e4b98317 100644 --- a/sd/source/ui/dlg/gluectrl.cxx +++ b/sd/source/ui/dlg/gluectrl.cxx @@ -134,7 +134,7 @@ void GlueEscDirLB::Fill() * Constructor for glue point escape direction toolbox control */ SdTbxCtlGlueEscDir::SdTbxCtlGlueEscDir( - sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx ) : + sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx ) : SfxToolBoxControl( nSlotId, nId, rTbx ) { } diff --git a/sd/source/ui/inc/diactrl.hxx b/sd/source/ui/inc/diactrl.hxx index 850779a4b4be..63786b962312 100644 --- a/sd/source/ui/inc/diactrl.hxx +++ b/sd/source/ui/inc/diactrl.hxx @@ -62,7 +62,7 @@ public: SFX_DECL_TOOLBOX_CONTROL(); - SdTbxCtlDiaPages(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx); + SdTbxCtlDiaPages(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx); virtual ~SdTbxCtlDiaPages() override; }; diff --git a/sd/source/ui/inc/gluectrl.hxx b/sd/source/ui/inc/gluectrl.hxx index 5176c980f402..c5a9b79fb901 100644 --- a/sd/source/ui/inc/gluectrl.hxx +++ b/sd/source/ui/inc/gluectrl.hxx @@ -63,7 +63,7 @@ public: SFX_DECL_TOOLBOX_CONTROL(); - SdTbxCtlGlueEscDir(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx); + SdTbxCtlGlueEscDir(sal_uInt16 nSlotId, ToolBoxItemId nId, ToolBox& rTbx); }; #endif // INCLUDED_SD_SOURCE_UI_INC_GLUECTRL_HXX -- cgit