ResourcePack.st
changeset 4932 b19b928b0026
parent 4848 18a6274df5d1
child 4947 9ed5d3a0cebf
--- a/ResourcePack.st	Fri Apr 04 15:40:51 2008 +0200
+++ b/ResourcePack.st	Tue Apr 08 18:55:34 2008 +0200
@@ -872,10 +872,12 @@
 string:s default:defaultString withArgs:argArray
     "translate and expand args"
 
-    |template|
+    |template stream|
 
     template := self at:s ifAbsent:defaultString.
-    ^ template expandPlaceholdersWith:argArray
+    stream := TextStream on:(template species new:template size + 20).
+    template expandPlaceholdersWith:argArray on:stream.
+    ^ stream contents.
 !
 
 string:s with:arg
@@ -914,12 +916,15 @@
 !
 
 string:s withArgs:argArray
-    "translate and expand args"
+    "translate and expand args - allow text as arguments"
 
-    |template|
+    |template stream|
 
     template := self at:s ifAbsent:s.
-    ^ template expandPlaceholdersWith:argArray
+
+    stream := TextStream on:(template species new:template size + 20).
+    template expandPlaceholdersWith:argArray on:stream.
+    ^ stream contents.
 !
 
 stringWithCRs:s
@@ -988,10 +993,12 @@
      CR-replacement is donw before args are inserted 
      i.e. if any arg contains a backslash (DOS filenames), those are not translated."
 
-    |template|
+    |template stream|
 
     template := self at:s ifAbsent:s.
-    ^ template withCRs expandPlaceholdersWith:argArray
+    stream := TextStream on:(template species new:template size + 20).
+    template withCRs expandPlaceholdersWith:argArray on:stream.
+    ^ stream contents.
 
     "Modified: / 21.3.2003 / 14:21:59 / cg"
 ! !
@@ -1288,7 +1295,7 @@
 !ResourcePack class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.126 2007-12-06 14:43:13 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.127 2008-04-08 16:55:34 stefan Exp $'
 ! !
 
 ResourcePack initialize!