From 8460e00cc0d9d43fad4eee52706968dc21b3a2cc Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Wed, 30 Jun 2010 14:49:42 +0000 Subject: [PATCH] _AddDynamicItems didn't pass the keyDown parameter to _OkToProceed (noticed by Ziusudra). Also removed leftover fDynamicItemsAdded. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37314 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/interface/Menu.h | 7 ++----- src/kits/interface/Menu.cpp | 10 +++------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/headers/os/interface/Menu.h b/headers/os/interface/Menu.h index a86c9d9798..9a5298b963 100644 --- a/headers/os/interface/Menu.h +++ b/headers/os/interface/Menu.h @@ -249,7 +249,7 @@ private: uint32& trigger, BPrivate::TriggerList& triggers); void _UpdateWindowViewSize(const bool &updatePosition); - bool _AddDynamicItems(); + bool _AddDynamicItems(bool keyDown = false); bool _OkToProceed(BMenuItem* item, bool keyDown = false); @@ -282,10 +282,7 @@ private: LayoutData* fLayoutData; - bool fDynamicItemsAdded; - bool _reserved1; - bool _reserved2; - bool _reserved3; + int32 _reserved; char fTrigger; bool fResizeToFit; diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index a0a57a7ce4..278d687396 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -210,7 +210,6 @@ BMenu::BMenu(const char* name, menu_layout layout) fMaxContentWidth(0.0f), fInitMatrixSize(NULL), fExtraMenuData(NULL), - fDynamicItemsAdded(false), fTrigger(0), fResizeToFit(true), fUseCachedMenuLayout(false), @@ -245,7 +244,6 @@ BMenu::BMenu(const char* name, float width, float height) fMaxContentWidth(0.0f), fInitMatrixSize(NULL), fExtraMenuData(NULL), - fDynamicItemsAdded(false), fTrigger(0), fResizeToFit(true), fUseCachedMenuLayout(false), @@ -281,7 +279,6 @@ BMenu::BMenu(BMessage* archive) fMaxContentWidth(0.0f), fInitMatrixSize(NULL), fExtraMenuData(NULL), - fDynamicItemsAdded(false), fTrigger(0), fResizeToFit(true), fUseCachedMenuLayout(false), @@ -1244,7 +1241,6 @@ BMenu::BMenu(BRect frame, const char* name, uint32 resizingMode, uint32 flags, fMaxContentWidth(0.0f), fInitMatrixSize(NULL), fExtraMenuData(NULL), - fDynamicItemsAdded(false), fTrigger(0), fResizeToFit(resizeToFit), fUseCachedMenuLayout(false), @@ -1472,7 +1468,7 @@ BMenu::_Show(bool selectFirstItem, bool keyDown) if (window->Lock()) { bool attachAborted = false; if (keyDown) - attachAborted = _AddDynamicItems(); + attachAborted = _AddDynamicItems(keyDown); if (attachAborted) { if (ourWindow) @@ -2749,7 +2745,7 @@ BMenu::_UpdateWindowViewSize(const bool &move) bool -BMenu::_AddDynamicItems() +BMenu::_AddDynamicItems(bool keyDown) { bool attachAborted = false; BMenuItem* superItem = Superitem(); @@ -2757,7 +2753,7 @@ BMenu::_AddDynamicItems() if (AddDynamicItem(B_INITIAL_ADD)) { do { if (superMenu != NULL - && !superMenu->_OkToProceed(superItem)) { + && !superMenu->_OkToProceed(superItem, keyDown)) { AddDynamicItem(B_ABORT); attachAborted = true; break;