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