DSVColumnView.st
changeset 5347 e0b26e38ee0f
parent 5310 8b7aff55b666
child 5421 3fd7edaeb379
--- a/DSVColumnView.st	Sun Nov 20 13:21:02 2016 +0100
+++ b/DSVColumnView.st	Tue Nov 22 10:03:11 2016 +0100
@@ -2813,28 +2813,6 @@
     ]
 !
 
-findFirstColumnWithStringFrom:start to:stop
-    start to:stop do:[:eachNr| 
-        |row lbl|
-        row := self at:eachNr.
-        columnDescriptors keysAndValuesDo:[:colNr :col |    
-            lbl := col shownValueForRow:row rowNr:eachNr.
-
-            (lbl isSequenceable and:[lbl isString not]) ifTrue:[
-                lbl := lbl at:1 ifAbsent:nil
-            ].
-
-            (lbl respondsTo:#string) ifTrue:[
-                lbl := lbl string.
-            ].
-            (lbl size > 0 and:[(lbl at:1) isCharacter]) ifTrue:[
-                ^ colNr
-            ]
-        ]
-    ].
-    ^ nil
-!
-
 findMenuForSelection
     "find the middle button menu for the current selection; returns the menu or nil"
     
@@ -4125,23 +4103,49 @@
 
 !DSVColumnView methodsFor:'searching'!
 
+findFirstColumnWithStringFrom:start to:stop
+    start to:stop do:[:eachNr| 
+        |row lbl|
+
+        row := self at:eachNr.
+        columnDescriptors keysAndValuesDo:[:colNr :col |    
+            lbl := col shownValueForRow:row rowNr:eachNr.
+
+            lbl isNonByteCollection ifTrue:[
+                lbl := lbl isEmpty ifTrue:[nil] ifFalse:[lbl first].
+            ].
+            (lbl respondsTo:#string) ifTrue:[
+                lbl := lbl string.
+            ].
+            (lbl size ~~ 0 and:[(lbl at:1) isCharacter]) ifTrue:[
+                ^ colNr
+            ]
+        ]
+    ].
+    ^ nil
+!
+
 findFirstRowWithString: aString from:start to:stop by: step ignoreCase:ignoreCase
-
     "Return the rowNr from the first row that matches aString.
-    The search is performed between the start and stop row numbers and incrementing by a step"
-
-    aString isEmptyOrNil ifTrue:[^self].
-    start to:stop by: step do:[:rowNr| 
-        |row lbl stringToMatch |
-        stringToMatch := '*',aString, '*'.
+     The search is performed between the start and stop row numbers and incrementing by a step"
+
+    |stringToMatch|
+
+    aString isEmptyOrNil ifTrue:[
+        ^ self
+    ].
+    stringToMatch := '*', aString, '*'.
+
+    start to:stop by:step do:[:rowNr| 
+        |row lbl|
+
         row := self at:rowNr.
         columnDescriptors keysAndValuesDo:[:colNr :col |    
             lbl := col shownValueForRow:row rowNr:rowNr.
 
-            (lbl isSequenceable and:[lbl isString not]) ifTrue:[
-                lbl := lbl at:1 ifAbsent:nil
+            lbl isNonByteCollection ifTrue:[
+                lbl := lbl isEmpty ifTrue:[nil] ifFalse:[lbl first].
             ].
-
             (lbl respondsTo:#string) ifTrue:[
                 lbl := lbl string.
             ].
@@ -4149,9 +4153,9 @@
                 lbl := lbl printString.
             ].
 
-            (lbl size > 0 
-                and:[ (lbl at:1) isCharacter 
-                and:[ stringToMatch match:lbl caseSensitive:ignoreCase not
+            (lbl size ~~ 0 
+                and:[(lbl at:1) isCharacter 
+                and:[stringToMatch match:lbl caseSensitive:ignoreCase not
             ]]) ifTrue:[
                 ^ rowNr
             ]
@@ -4161,11 +4165,10 @@
 !
 
 findFirstRowWithString: aString from:start to:stop ignoreCase:ignoreCase
-
     "Return the rowNr from the first row that matches aString.
-    The search is performed between the start and stop row numbers"
-
-    ^self findFirstRowWithString: aString from:start to:stop by:1 ignoreCase:ignoreCase
+     The search is performed between the start and stop row numbers"
+
+    ^ self findFirstRowWithString:aString from:start to:stop by:1 ignoreCase:ignoreCase
 ! !
 
 !DSVColumnView methodsFor:'selection'!