UIHelpTool.st
changeset 299 62009576ca33
parent 292 af69e3e025a9
child 319 f16aa0e8541e
--- a/UIHelpTool.st	Tue Sep 02 14:21:17 1997 +0200
+++ b/UIHelpTool.st	Tue Sep 02 14:25:07 1997 +0200
@@ -511,7 +511,7 @@
 listSelection:aSelection
     "current selection changed
     "
-    |txt col line view sel|
+    |txt view sel|
 
     aSelection isNumber ifTrue:[
         aSelection ~~ 0 ifTrue:[
@@ -526,44 +526,24 @@
         ]
     ].
 
-    listSelection = sel ifTrue:[
-        ^ self
-    ].
-    listSelection := sel.
+    listSelection = sel ifFalse:[
+        listSelection := sel.
 
-    modifiedHolder notNil ifTrue:[
-        modifiedHolder value:true.
-    ].
-
-    (view := self editTextView) isNil ifTrue:[
-        ^ self
-    ].
+        modifiedHolder notNil ifTrue:[
+            modifiedHolder value:true.
+        ].
 
-    listSelection notNil ifTrue:[
-        txt := dictionary at:(listSelection asSymbol) ifAbsent:nil.
-    ].
-
-    (txt isNil or:[maxCharsPerLine isNil]) ifTrue:[
-        col := txt.
-    ] ifFalse:[
-        col := OrderedCollection new.
+        (view := self editTextView) notNil ifTrue:[
+            listSelection notNil ifTrue:[
+                txt := dictionary at:(listSelection asSymbol) ifAbsent:nil.
 
-        txt asString asCollectionOfWords do:[:aWord|
-            line isNil ifTrue:[
-                line := aWord
-            ] ifFalse:[
-                (line size + aWord size) >= maxCharsPerLine ifTrue:[
-                    col add:line.
-                    line := aWord
-                ] ifFalse:[
-                    line := line, ' ', aWord
+                (txt isNil or:[maxCharsPerLine isNil]) ifFalse:[
+                    txt := UIPainter convertString:(txt asString) maxLineSize:maxCharsPerLine.
                 ]
             ].
-        ].
-        line notNil ifTrue:[col add:line].
-    ].
-    view contents:col.    
-
+            view contents:txt.    
+        ]
+    ]
 
 ! !