summaryrefslogtreecommitdiff
path: root/framework/source/uielement/toolbarmerger.cxx
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-03-08 21:37:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-11 14:10:30 +0100
commit1692998399eecb79e7b59456cff805bcb77aece4 (patch)
tree8cc22c633e88f19c39f5736e87a0934f041729de /framework/source/uielement/toolbarmerger.cxx
parent665a2b477dd4f412b42ffb58a183f7a702cd7645 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source/uielement/toolbarmerger.cxx')
-rw-r--r--framework/source/uielement/toolbarmerger.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/framework/source/uielement/toolbarmerger.cxx b/framework/source/uielement/toolbarmerger.cxx
index 297f38cba9ad..652383988bcd 100644
--- a/framework/source/uielement/toolbarmerger.cxx
+++ b/framework/source/uielement/toolbarmerger.cxx
@@ -238,8 +238,8 @@ ReferenceToolbarPathInfo ToolBarMerger::FindReferencePoint(
for ( ToolBox::ImplToolItems::size_type i = 0; i < nSize; i++ )
{
- const sal_uInt16 nItemId = pToolbar->GetItemId( i );
- if ( nItemId > 0 )
+ const ToolBoxItemId nItemId = pToolbar->GetItemId( i );
+ if ( nItemId > ToolBoxItemId(0) )
{
const OUString rCmd = pToolbar->GetItemCommand( nItemId );
if ( rCmd == rReferencePoint )
@@ -303,7 +303,7 @@ ReferenceToolbarPathInfo ToolBarMerger::FindReferencePoint(
bool ToolBarMerger::ProcessMergeOperation(
ToolBox* pToolbar,
ToolBox::ImplToolItems::size_type nPos,
- sal_uInt16& rItemId,
+ ToolBoxItemId& rItemId,
CommandToInfoMap& rCommandMap,
std::u16string_view rModuleIdentifier,
std::u16string_view rMergeCommand,
@@ -366,7 +366,7 @@ bool ToolBarMerger::ProcessMergeOperation(
*/
bool ToolBarMerger::ProcessMergeFallback(
ToolBox* pToolbar,
- sal_uInt16& rItemId,
+ ToolBoxItemId& rItemId,
CommandToInfoMap& rCommandMap,
std::u16string_view rModuleIdentifier,
std::u16string_view rMergeCommand,
@@ -430,7 +430,7 @@ void ToolBarMerger::MergeItems(
ToolBox* pToolbar,
ToolBox::ImplToolItems::size_type nPos,
sal_uInt16 nModIndex,
- sal_uInt16& rItemId,
+ ToolBoxItemId& rItemId,
CommandToInfoMap& rCommandMap,
std::u16string_view rModuleIdentifier,
const AddonToolbarItemContainer& rAddonToolbarItems )
@@ -511,7 +511,7 @@ void ToolBarMerger::MergeItems(
void ToolBarMerger::ReplaceItem(
ToolBox* pToolbar,
ToolBox::ImplToolItems::size_type nPos,
- sal_uInt16& rItemId,
+ ToolBoxItemId& rItemId,
CommandToInfoMap& rCommandMap,
std::u16string_view rModuleIdentifier,
const AddonToolbarItemContainer& rAddonToolbarItems )
@@ -587,7 +587,7 @@ rtl::Reference<::cppu::OWeakObject> ToolBarMerger::CreateController(
const uno::Reference< frame::XFrame > & xFrame,
ToolBox* pToolbar,
const OUString& rCommandURL,
- sal_uInt16 nId,
+ ToolBoxItemId nId,
sal_uInt16 nWidth,
std::u16string_view rControlType )
{
@@ -621,7 +621,7 @@ rtl::Reference<::cppu::OWeakObject> ToolBarMerger::CreateController(
return pResult;
}
-void ToolBarMerger::CreateToolbarItem( ToolBox* pToolbar, ToolBox::ImplToolItems::size_type nPos, sal_uInt16 nItemId, const AddonToolbarItem& rItem )
+void ToolBarMerger::CreateToolbarItem( ToolBox* pToolbar, ToolBox::ImplToolItems::size_type nPos, ToolBoxItemId nItemId, const AddonToolbarItem& rItem )
{
pToolbar->InsertItem( nItemId, rItem.aLabel, ToolBoxItemBits::NONE, nPos );
pToolbar->SetItemCommand( nItemId, rItem.aCommandURL );