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