--- 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