do not return twice from a block
authorClaus Gittinger <cg@exept.de>
Mon, 05 May 2008 14:40:08 +0200
changeset 3594 e298287e2968
parent 3593 0de12c5b752a
child 3595 9277e3a4d2e9
do not return twice from a block
PopUpMenu.st
--- a/PopUpMenu.st	Mon May 05 14:36:06 2008 +0200
+++ b/PopUpMenu.st	Mon May 05 14:40:08 2008 +0200
@@ -886,57 +886,57 @@
 
             selected isNil ifTrue:[
                 "/ the menu has already sent a message or performed an item-action; do nothing here
-                ^ retVal
-            ].
-
-            selIdx := menuView selection.
-
-            args := menuView args.
-            selectors := menuView selectors.
-            checkFlags := menuView checkFlags.
-
-            args isNil ifTrue:[
-                selectors notNil ifTrue:[
-                    sel0 := selectors at:selIdx.
-                ].
+                retVal
             ] ifFalse:[
-                actionIndex := selected.
-                actionIndex notNil ifTrue:[
-                    actionValues isNil ifTrue:[
-                        selectors notNil ifTrue:[
-                            "/ mhmh an ST/X menu started the ST-80 way
+                selIdx := menuView selection.
 
-                            sel1 := selectors at:selIdx.
-                            arg := actionIndex.
-                        ] ifFalse:[
-                            retVal := actionIndex
-                        ]
-                    ] ifFalse:[
-                        retVal := actionValues at:actionIndex.
-                        (retVal isKindOf:PopUpMenu) ifTrue:[
-                            retVal := retVal startUp
-                        ]
-                    ]
-                ] ifFalse:[
-                    "/ mhmh an ST/X menu started the ST-80 way
+                args := menuView args.
+                selectors := menuView selectors.
+                checkFlags := menuView checkFlags.
 
+                args isNil ifTrue:[
                     selectors notNil ifTrue:[
                         sel0 := selectors at:selIdx.
                     ].
-                ]
-            ].
+                ] ifFalse:[
+                    actionIndex := selected.
+                    actionIndex notNil ifTrue:[
+                        actionValues isNil ifTrue:[
+                            selectors notNil ifTrue:[
+                                "/ mhmh an ST/X menu started the ST-80 way
 
-            checkFlags notNil ifTrue:[
-                check := checkFlags at:selIdx.
-                check notNil ifTrue:[
-                    arg := check.
-                    sel1 := sel0.
-                    sel0 := nil.
-                ]
-            ].
-            return := retVal.
+                                sel1 := selectors at:selIdx.
+                                arg := actionIndex.
+                            ] ifFalse:[
+                                retVal := actionIndex
+                            ]
+                        ] ifFalse:[
+                            retVal := actionValues at:actionIndex.
+                            (retVal isKindOf:PopUpMenu) ifTrue:[
+                                retVal := retVal startUp
+                            ]
+                        ]
+                    ] ifFalse:[
+                        "/ mhmh an ST/X menu started the ST-80 way
 
-            menuView action:nil
+                        selectors notNil ifTrue:[
+                            sel0 := selectors at:selIdx.
+                        ].
+                    ]
+                ].
+
+                checkFlags notNil ifTrue:[
+                    check := checkFlags at:selIdx.
+                    check notNil ifTrue:[
+                        arg := check.
+                        sel1 := sel0.
+                        sel0 := nil.
+                    ]
+                ].
+                return := retVal.
+
+                menuView action:nil
+            ]
         ]
     ].
 
@@ -1606,5 +1606,5 @@
 !PopUpMenu class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/PopUpMenu.st,v 1.99 2007-08-18 14:55:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/PopUpMenu.st,v 1.100 2008-05-05 12:40:08 cg Exp $'
 ! !