[Uml-devel] branches/work/soc-umbrello/umbrello

Gopala Krishna A krishna.ggk at gmail.com
Sun Jul 20 20:55:24 UTC 2008


SVN commit 835609 by gopala:

Removed check for Menu pointer and umlObject() for non null as they should never be null.
Crashes infact help us trace the bug location which calls this methods with null pointer.


 M  +2 -9      enumwidget.cpp  


--- branches/work/soc-umbrello/umbrello/enumwidget.cpp #835608:835609
@@ -117,19 +117,12 @@
 
 void EnumWidget::slotMenuSelection(QAction *action)
 {
+	// The menu is passed in as parameter of action
     ListPopupMenu *menu = qobject_cast<ListPopupMenu*>(action->parent());
-    if (!menu) {
-        uError() << "ListPopupMenu's pointer should be the parent of the action parameter of this slot";
-        return;
-    }
-
     ListPopupMenu::Menu_Type sel = menu->getMenuType(action);
 
     if (sel == ListPopupMenu::mt_EnumLiteral) {
-        if (!umlObject()) {
-            uWarning() << "There is no UMLObject for this widget to create the literal!";
-        }
-        else if (Object_Factory::createChildObject(static_cast<UMLClassifier*>(umlObject()),
+		if (Object_Factory::createChildObject(static_cast<UMLClassifier*>(umlObject()),
                                               Uml::ot_EnumLiteral) )  {
             UMLApp::app()->getDocument()->setModified();
         }




More information about the umbrello-devel mailing list