changed: #doSave
authorClaus Gittinger <cg@exept.de>
Mon, 22 Aug 2011 10:36:39 +0200
changeset 2856 8f5778095338
parent 2855 955a5d0c2d26
child 2857 6fcc59a87afb
changed: #doSave oops - excla in labels did not work
MenuEditor.st
--- a/MenuEditor.st	Fri Aug 19 09:44:25 2011 +0200
+++ b/MenuEditor.st	Mon Aug 22 10:36:39 2011 +0200
@@ -2736,7 +2736,7 @@
            class: specClass
         selector: specSelector
     "
-    |cls specCode mthd category code excla|
+    |cls specCode mthd category code excla s|
 
     self isEditingSpecOnly ifTrue:[
         savedSpec := self generateMenuSpec.
@@ -2758,29 +2758,33 @@
         category := mthd category.
     ].
 
-    excla := Character excla asString.
-
-    code := excla
-            , (cls name , ' class methodsFor:' , category storeString)
-            , excla , '\\'
-
-            , specSelector , '\'
-            , (self class codeGenerationComment replChar:$!! withString:'!!!!')
-            , '\\    "\'
-            , ('     MenuEditor new openOnClass:' , cls name , ' andSelector:#' , specSelector , '\')
-            , ('     (Menu new fromLiteralArrayEncoding:(' , cls name , ' ' , specSelector , ')) startUp\')
-            , '    "\'.
-
-    code := code
-            , '\'
-            , '    <resource: #menu>\\'
-            , '    ^ ' , specCode
-            , '\'
-            , (excla , ' ' , excla)
-            , '\\'.
-
-    code := code withCRs.
-    (ReadStream on:code) fileIn.
+    s := '' writeStream.
+
+    s nextPutChunkSeparator;
+      nextPutAll:(cls name);
+      nextPutAll:' class methodsFor:';
+      nextPutAll:category storeString;
+      nextPutChunkSeparator;
+      cr; cr;
+      nextPutAll:specSelector;
+      cr;
+      nextPutAllAsChunk:(self class codeGenerationComment) withCRs;
+      cr; cr; 
+      nextPutLine:'    "';
+      nextPutLine:('     MenuEditor new openOnClass:' , cls name , ' andSelector:#' , specSelector);
+      nextPutLine:('     (Menu new fromLiteralArrayEncoding:(' , cls name , ' ' , specSelector , ')) startUp');
+      nextPutLine:'    "';
+      cr;
+      nextPutLine:'    <resource: #menu>';
+      cr;
+      nextPutAll:'    ^ ';
+      nextChunkPut:specCode;
+      space;
+      nextPutChunkSeparator;
+      cr.
+
+self halt.
+    (ReadStream on:s contents) fileIn.
 
     self isStandAlone ifTrue:[
         self helpTool doSave
@@ -2789,6 +2793,8 @@
     self updateHistory.
     hasSaved := true.
     self clearModified.
+
+    "Modified: / 22-08-2011 / 10:28:17 / cg"
 !
 
 doSaveAs