[Libreoffice-commits] core.git: vcl/source

Stephan Bergmann sbergman at redhat.com
Sun Mar 12 13:09:53 UTC 2017


 vcl/source/window/toolbox2.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c6d0dd62f7aa92be723317c8be518136eec26893
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Sun Mar 12 14:07:14 2017 +0100

    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
    ae5f75ab0515f8ee63813ec9284fbfb2124f0a5d "Allow a common op. on a disposed
    toolbox", probably by accident.)
    
    Change-Id: Id767b1d8d0b3cdfdc0ec525f165d75ae0cef7301

diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 83eaffc..a4da7c3 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -789,7 +789,7 @@ Size ToolBox::GetItemContentSize( sal_uInt16 nItemId ) const
 sal_uInt16 ToolBox::GetItemId(const OUString &rCommand) const
 {
     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)
     {


More information about the Libreoffice-commits mailing list