class: ListView
authorClaus Gittinger <cg@exept.de>
Tue, 03 Sep 2013 22:06:14 +0200
changeset 4734 f10054600ad2
parent 4733 d623925e0257
child 4735 415403266a32
class: ListView changed: #getListFromModel ListView was doing an asStringCollection to the model's value. This is BAD BAD BAD, as it breaks huge-contents tuning via VirtualArrays. This IS required both for the Telecom and maybe other applciations. It is definitely used in the fileBrowser's hex dump. This change back to the old code may break code which has been developed in the meantime (with this bug active). If you encounter any, please fix there - not by converting here to an in-memory collection!
ListView.st
--- a/ListView.st	Tue Sep 03 21:27:51 2013 +0200
+++ b/ListView.st	Tue Sep 03 22:06:14 2013 +0200
@@ -2626,23 +2626,28 @@
     |text msg|
 
     model notNil ifTrue:[
-	msg := listMsg ? aspectMsg.
-
-	msg notNil ifTrue:[
-	    text := model perform:msg.
-	    text notNil ifTrue:[
-		text := text asStringCollection.
-	    ].
-  "/ SV: this compare does not work, if model uses (i.e. updates)
-  "/ the same stringCollection as the view!!
-"/            text ~= list ifTrue:[
-		scrollLocked == true ifTrue:[
-		    self setList:text
-		] ifFalse:[
-		    self list:text
-		]
-"/            ].
-	].
+        msg := listMsg ? aspectMsg.
+
+        msg notNil ifTrue:[
+            text := model perform:msg.
+            "/ cg: this makes many optimizations (virtualArray) useless;
+            "/ I do not think that this is a good idea!!
+            "/     text notNil ifTrue:[
+            "/ so I changed it to:
+            (text notNil and:[text isString]) ifTrue:[
+                text := text asStringCollection.
+            ].
+
+            "/ SV: this compare does not work, if model uses (i.e. updates)
+            "/ the same stringCollection as the view!!
+            true "text ~= list" ifTrue:[
+                scrollLocked == true ifTrue:[
+                    self setList:text
+                ] ifFalse:[
+                    self list:text
+                ]
+            ].
+        ].
     ].
 
     "Modified: 26.4.1996 / 14:09:42 / cg"
@@ -4926,10 +4931,10 @@
 !ListView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.377 2013-09-03 19:24:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.378 2013-09-03 20:06:14 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.377 2013-09-03 19:24:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ListView.st,v 1.378 2013-09-03 20:06:14 cg Exp $'
 ! !