care for nil selection
authorca
Wed, 12 Feb 1997 11:19:58 +0100
changeset 1002 62b2636d0923
parent 1001 eb7a8b2f4347
child 1003 b1affa654489
care for nil selection
ObjView.st
ObjectView.st
--- a/ObjView.st	Wed Feb 12 02:08:25 1997 +0100
+++ b/ObjView.st	Wed Feb 12 11:19:58 1997 +0100
@@ -2450,6 +2450,9 @@
     "add anObject to the selection; redraw it selected"
 
     selection isCollection ifFalse:[
+        selection isNil ifTrue:[
+            ^ self select:anObject
+        ].
         selection := OrderedCollection with:selection
     ].
 
@@ -2494,6 +2497,10 @@
         ].
         (selection size == 1) ifTrue:[
             selection := selection first
+        ] ifFalse:[
+            selection isEmpty ifTrue:[
+                selection := nil
+            ]
         ]
     ] ifFalse:[
         (selection == anObject) ifTrue:[
@@ -2918,5 +2925,5 @@
 !ObjectView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ObjView.st,v 1.54 1997-02-11 19:07:17 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ObjView.st,v 1.55 1997-02-12 10:19:58 ca Exp $'
 ! !
--- a/ObjectView.st	Wed Feb 12 02:08:25 1997 +0100
+++ b/ObjectView.st	Wed Feb 12 11:19:58 1997 +0100
@@ -2450,6 +2450,9 @@
     "add anObject to the selection; redraw it selected"
 
     selection isCollection ifFalse:[
+        selection isNil ifTrue:[
+            ^ self select:anObject
+        ].
         selection := OrderedCollection with:selection
     ].
 
@@ -2494,6 +2497,10 @@
         ].
         (selection size == 1) ifTrue:[
             selection := selection first
+        ] ifFalse:[
+            selection isEmpty ifTrue:[
+                selection := nil
+            ]
         ]
     ] ifFalse:[
         (selection == anObject) ifTrue:[
@@ -2918,5 +2925,5 @@
 !ObjectView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ObjectView.st,v 1.54 1997-02-11 19:07:17 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ObjectView.st,v 1.55 1997-02-12 10:19:58 ca Exp $'
 ! !