#BUGFIX by stefan
authorStefan Vogel <sv@exept.de>
Tue, 03 Jan 2017 19:05:17 +0100
changeset 6019 a801624144ea
parent 6018 3309575c93e4
child 6020 79c1a6bb497a
child 6024 7fdee3dcd61a
#BUGFIX by stefan class: ListView changed: #textFromLine:col:toLine:col: answer an empty StringCollection (instead od an empty String) if there is no selection fixes DNU when searching in TextView
ListView.st
--- a/ListView.st	Tue Jan 03 10:51:45 2017 +0100
+++ b/ListView.st	Tue Jan 03 19:05:17 2017 +0100
@@ -1526,29 +1526,29 @@
     endLine isNil ifTrue:[^ nil].
 
     (startLine == endLine) ifTrue:[
-	"part of a line"
-	^ StringCollection with:(self listAt:startLine from:startCol to:endCol)
+        "part of a line"
+        ^ StringCollection with:(self listAt:startLine from:startCol to:endCol)
     ].
 
     sz := endLine - startLine + 1.
-    sz < 1 ifTrue:[^ ''].
+    sz < 1 ifTrue:[^ StringCollection new].
 
     text := StringCollection new:sz.
 
     "get 1st and last (possibly) partial lines"
     text at:1 put:(self listAt:startLine from:startCol).
     endCol == 0 ifTrue:[
-	last := ''
+        last := ''
     ] ifFalse:[
-	last := self listAt:endLine to:endCol.
+        last := self listAt:endLine to:endCol.
     ].
     text at:sz put:last.
 
     "get bulk of text"
     index := 2.
     (startLine + 1) to:(endLine - 1) do:[:lineNr |
-	text at:index put:(self listAt:lineNr).
-	index := index + 1
+        text at:index put:(self listAt:lineNr).
+        index := index + 1
     ].
     ^ text