Minor changes, fixed a possible leak in Uninstall()

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16773 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2006-03-13 20:36:04 +00:00
parent 3417ac5629
commit deab92e7ed

View File

@ -625,8 +625,7 @@ BMenuItem::Uninstall()
if (Target() == fWindow)
SetTarget(BMessenger());
// TODO: I'm not sure about B_COMMAND_KEY
if (fShortcutChar != 0 && (fModifiers & B_COMMAND_KEY) && fWindow != NULL)
if (fShortcutChar != 0 && fModifiers != 0 && fWindow != NULL)
fWindow->RemoveShortcut(fShortcutChar, fModifiers);
fWindow = NULL;
@ -652,10 +651,7 @@ BMenuItem::Select(bool selected)
if (fSelected == selected)
return;
if (Submenu()) {
fSelected = selected;
Highlight(selected);
} else if (IsEnabled()) {
if (Submenu() || IsEnabled()) {
fSelected = selected;
Highlight(selected);
}