From 05a52116dfa39a07bc5739340eb1a84660c96e25 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sat, 15 Jan 2011 21:37:45 +0100 Subject: MenuItem::isEnabled() is sufficient to decide Menu::isItemSelectable() MenuSeparator is never enabled since it returns always 'false' in its implementation of isEnabled(). no need to use RTTI imho. --- src/FbTk/Menu.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index f46efb0..5531410 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -842,9 +842,7 @@ bool Menu::isItemSelectable(unsigned int index) const { if (index >= menuitems.size()) return false; const MenuItem *item = find(index); - return (!item || - (typeid(*item) == typeid(FbTk::MenuSeparator)) || - !item->isEnabled()) ? false : true; + return (!item || !item->isEnabled()) ? false : true; } -- cgit v0.11.2