A couple of small style changes, fixed a problem with some compilers
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11392 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -110,7 +110,7 @@ sPropList[] = {
|
||||
{ B_NAME_SPECIFIER, B_INDEX_SPECIFIER, B_REVERSE_INDEX_SPECIFIER, 0 },
|
||||
"Directs scripting message to the specified menu, first popping the current "
|
||||
"specifier off the stack." },
|
||||
{}
|
||||
{0}
|
||||
};
|
||||
|
||||
|
||||
@@ -430,8 +430,8 @@ BMenu::ItemAt(int32 index) const
|
||||
BMenu *
|
||||
BMenu::SubmenuAt(int32 index) const
|
||||
{
|
||||
BMenuItem *tempItem=static_cast<BMenuItem *>(fItems.ItemAt(index));
|
||||
return (tempItem) ? tempItem->Submenu() : NULL;
|
||||
BMenuItem *item = static_cast<BMenuItem *>(fItems.ItemAt(index));
|
||||
return (item != NULL) ? item->Submenu() : NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -446,7 +446,7 @@ int32
|
||||
BMenu::IndexOf(BMenu *submenu) const
|
||||
{
|
||||
for (int32 i = 0; i < fItems.CountItems(); i++)
|
||||
if (static_cast<BMenuItem *>(fItems.ItemAt(i))->Submenu() == submenu)
|
||||
if (ItemAt(i)->Submenu() == submenu)
|
||||
return i;
|
||||
|
||||
return -1;
|
||||
@@ -501,7 +501,7 @@ status_t
|
||||
BMenu::SetTargetForItems(BHandler *handler)
|
||||
{
|
||||
for (int32 i = 0; i < fItems.CountItems(); i++)
|
||||
if (static_cast<BMenuItem *>(fItems.ItemAt(i))->SetTarget(handler) != B_OK)
|
||||
if (ItemAt(i)->SetTarget(handler) < B_OK)
|
||||
return B_ERROR;
|
||||
|
||||
return B_OK;
|
||||
@@ -512,7 +512,7 @@ status_t
|
||||
BMenu::SetTargetForItems(BMessenger messenger)
|
||||
{
|
||||
for (int32 i = 0; i < fItems.CountItems(); i++)
|
||||
if (ItemAt(i)->SetTarget(messenger) != B_OK)
|
||||
if (ItemAt(i)->SetTarget(messenger) < B_OK)
|
||||
return B_ERROR;
|
||||
|
||||
return B_OK;
|
||||
@@ -1163,13 +1163,13 @@ BMenu::_AddItem(BMenuItem *item, int32 index)
|
||||
{
|
||||
ASSERT(item != NULL);
|
||||
|
||||
item->SetSuper(this);
|
||||
|
||||
bool err = fItems.AddItem(item, index);
|
||||
|
||||
if (!err)
|
||||
return err;
|
||||
|
||||
item->SetSuper(this);
|
||||
|
||||
// Make sure we update the layout in case we are already attached.
|
||||
if (Window() && fResizeToFit) {
|
||||
LayoutItems(index);
|
||||
|
||||
Reference in New Issue
Block a user