From 1ae414f3c63773e8ac73ecd11eeec41b6bf2638e Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Mon, 4 Jul 2005 21:31:03 +0000 Subject: [PATCH] Don't assume we have an owner. This fixes a crash in MenuWorld, but needs more investigation git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13427 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Menu.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index 37fcd74cb3..90aac62cae 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -1224,7 +1224,7 @@ BMenu::RemoveItems(int32 index, int32 count, BMenuItem *_item, bool del) } InvalidateLayout(); - + return result; } @@ -1336,9 +1336,11 @@ BMenu::ComputeLayout(int32 index, bool bestFit, bool moveItems, if ((ResizingMode() & B_FOLLOW_LEFT_RIGHT) == B_FOLLOW_LEFT_RIGHT) { if (Parent()) *width = Parent()->Frame().Width() + 1; - else + else if (Window()) *width = Window()->Frame().Width() + 1; + // TODO: We are left without a valid width here ?!? + *height = frame.Height(); } else { *width = frame.Width();