summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/window/builder.cxx6
-rw-r--r--vcl/source/window/menu.cxx4
-rw-r--r--vcl/source/window/toolbox2.cxx5
3 files changed, 4 insertions, 11 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index ad800893b75f..11efd79cc089 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1668,10 +1668,8 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
}
else
{
- const sal_uInt16 COMMAND_ITEMID_START = 30000;
- nItemId = COMMAND_ITEMID_START + pToolBox->GetItemCount();
- pToolBox->InsertItem(nItemId,
- OStringToOUString(extractLabel(rMap), RTL_TEXTENCODING_UTF8), nBits);
+ nItemId = pToolBox->GetItemCount() + 1;
+ pToolBox->InsertItem(nItemId, OStringToOUString(extractLabel(rMap), RTL_TEXTENCODING_UTF8), nBits);
pToolBox->SetItemCommand(nItemId, aCommand);
pToolBox->SetHelpId(nItemId, m_sHelpRoot + id);
}
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 803c8a456a1a..3a6e54c67f03 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -533,9 +533,7 @@ void Menu::InsertItem(const OUString& rCommand, const uno::Reference<frame::XFra
OUString aTooltip(CommandInfoProvider::Instance().GetTooltipForCommand(rCommand, rFrame));
Image aImage(CommandInfoProvider::Instance().GetImageForCommand(rCommand, /*bLarge=*/ false, rFrame));
- // let's invent an ItemId
- const sal_uInt16 COMMAND_ITEMID_START = 30000;
- sal_uInt16 nItemId = COMMAND_ITEMID_START + GetItemCount();
+ sal_uInt16 nItemId = GetItemCount() + 1;
InsertItem(nItemId, aLabel, aImage, nBits, rIdent, nPos);
SetItemCommand(nItemId, rCommand);
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 88995776f914..26d74981592e 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -601,10 +601,7 @@ void ToolBox::InsertItem(const OUString& rCommand, const uno::Reference<frame::X
OUString aTooltip(vcl::CommandInfoProvider::Instance().GetTooltipForCommand(rCommand, rFrame));
Image aImage(vcl::CommandInfoProvider::Instance().GetImageForCommand(rCommand, (GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE), rFrame));
- // let's invent an ItemId
- const sal_uInt16 COMMAND_ITEMID_START = 30000;
- sal_uInt16 nItemId = COMMAND_ITEMID_START + GetItemCount();
-
+ sal_uInt16 nItemId = GetItemCount() + 1;
InsertItem(nItemId, aImage, aLabel, nBits, nPos);
SetItemCommand(nItemId, rCommand);
SetQuickHelpText(nItemId, aTooltip);