#OTHER by Maren
authormatilk
Mon, 12 Sep 2016 16:25:22 +0200
changeset 5852 9543b58b0e6c
parent 5850 988655795073
child 5853 4f7a9587dcfa
child 5854 5b12827d92f7
#OTHER by Maren class: SelectionInListView changed: #setSelectElement: first search for the element itself; then for its string (in case non-textual elements are in there)
SelectionInListView.st
--- a/SelectionInListView.st	Sun Sep 11 15:42:45 2016 +0200
+++ b/SelectionInListView.st	Mon Sep 12 16:25:22 2016 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -4196,8 +4194,11 @@
     items notNil ifTrue:[
         lineNo := items findFirst:[:el | anObject = el]
     ] ifFalse:[
-        s := anObject string.
-        lineNo := list findFirst:[:el | s = el string]
+        lineNo := list indexOf:anObject ifAbsent:[nil].
+        lineNo isNil ifTrue:[
+            s := anObject string.
+            lineNo := list findFirst:[:el | s = el string]
+        ].
     ].
     lineNo ~~ 0 ifTrue:[
         self setSelection:lineNo