Kaydet (Commit) c6d0dd62 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Better use 0 instead of TOOLBOX_ITEM_NOTFOUND for "no ID available"

...return value from ToolBox::GetItemId, as is done in all other places where
such is returned from one of the ToolBox::GetItemId overloads.  And
TOOLBOX_ITEM_NOTFOUND is otherwise only used for item positions, not item IDs.
(This lone odd use of TOOLBOX_ITEM_NOTFOUND was introduced with
ae5f75ab "Allow a common op. on a disposed
toolbox", probably by accident.)

Change-Id: Id767b1d8d0b3cdfdc0ec525f165d75ae0cef7301
üst ff414fea
...@@ -789,7 +789,7 @@ Size ToolBox::GetItemContentSize( sal_uInt16 nItemId ) const ...@@ -789,7 +789,7 @@ Size ToolBox::GetItemContentSize( sal_uInt16 nItemId ) const
sal_uInt16 ToolBox::GetItemId(const OUString &rCommand) const sal_uInt16 ToolBox::GetItemId(const OUString &rCommand) const
{ {
if (!mpData) if (!mpData)
return TOOLBOX_ITEM_NOTFOUND; return 0;
for (std::vector<ImplToolItem>::const_iterator it = mpData->m_aItems.begin(); it != mpData->m_aItems.end(); ++it) for (std::vector<ImplToolItem>::const_iterator it = mpData->m_aItems.begin(); it != mpData->m_aItems.end(); ++it)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment