changed #singleSelection - make more comprehendable
authorStefan Vogel <sv@exept.de>
Tue, 05 Feb 2008 11:39:08 +0100
changeset 2267 f93749e64030
parent 2266 0234d226a06a
child 2268 52429abf9eab
changed #singleSelection - make more comprehendable
UIObjectView.st
--- a/UIObjectView.st	Mon Feb 04 16:00:39 2008 +0100
+++ b/UIObjectView.st	Tue Feb 05 11:39:08 2008 +0100
@@ -1289,17 +1289,16 @@
 !
 
 singleSelection
-    "checks whether one element is selected; in this case the element is
-     returned otherwise nil
-    "
-    |coll|
-
-    (coll := self selection) isCollection ifFalse:[
-        ^ coll
+    "checks whether a single element is selected; in this case the element is
+     returned otherwise nil"
+
+    |sel|
+
+    sel := self selection.
+    sel isCollection ifTrue:[
+        sel := sel size == 1 ifTrue:[sel first] ifFalse:[nil].
     ].
-
-    coll size == 1 ifTrue:[ ^ coll first].
-    ^ nil
+    ^ sel
 !
 
 singleSelectionDo:aBlock