The Trunk: System-nice.673.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: System-nice.673.mcz

commits-2
Nicolas Cellier uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-nice.673.mcz

==================== Summary ====================

Name: System-nice.673
Author: nice
Time: 18 July 2014, 12:01:22.459 am
UUID: 7ce38863-5e77-4e63-9407-74dddd563560
Ancestors: System-dtl.672

Continue to disentangle the nest of vipers, one knot at a time.
Replace usage of compressedMIMEEncodedStream, because
- we do not need a ReadWriteStream (such requirement should be so rare)
- we do not even need a ReadStream
- we just need a String
So let's use a String

=============== Diff against System-dtl.672 ===============

Item was changed:
  ----- Method: TextStyle class>>writeStyle:named:toChangeSet: (in category '*System-Changes-mime file in/out') -----
  writeStyle: aTextStyle named: familyName toChangeSet: csName
  "Write the text style to a change set, with a postscript that will re-load it.
  NOTE: to do TTCFonts, you have to have a working ShortPointArray endianness conversion."
  "
  TTCFont recreateCache.
  TextStyle writeStyle: (TextStyle named: #Arial) named: 'Arial' toChangeSet: 'ArialInstall'.
 
  TextStyle writeStyle: (TextStyle named: #Accuny) named: 'Accuny' toChangeSet: 'AccunyInstall2'.
  "
 
+ | cs mime |
- | cs mimeStream |
 
  cs := ChangeSet basicNewNamed: csName.
  cs adoptSelector: #collectionFromCompressedMIMEString: forClass: self class.
  cs adoptSelector: #replaceStyle:with: forClass: self class.
  cs adoptSelector: #replaceFontsIn:with: forClass: self class.
  cs adoptSelector: #looseFontsFromFamily: forClass: self class.
  ((aTextStyle fontArray copyWithout: nil) collect: [ :f | f class ]) asSet do: [ :cls  |
  cs adoptSelector: #derivativeFonts forClass: cls.
  cs adoptSelector: #releaseCachedState forClass: cls ].
 
  cs preambleString: (String streamContents: [ :s |
  s nextPutAll: '"Change Set: '; nextPutAll: csName; cr;
  nextPutAll: 'Date: '; print: Date today; cr;
  nextPutAll: 'Author: '; nextPutAll: Utilities authorName; cr; cr;
  nextPutAll: 'Installs the text style '''; nextPutAll: familyName; nextPutAll: ''''; cr;
  nextPutAll: 'from a compressed MIME encoding in the postscript."'; cr. ]).
 
+ mime := aTextStyle compressedMIMEEncoded.
- mimeStream := aTextStyle compressedMIMEEncodedStream.
 
  cs postscriptString: (String streamContents: [ :s | s
  nextPutAll: '"Postscript:'; cr;
  nextPutAll: 'Install the text style from the compressed MIME encoding, and replace the old one.';
  nextPut: $"; cr;
  nextPutAll: 'TextConstants at: #';
  nextPutAll: familyName;
  nextPutAll: ' ifPresent: [ :oldStyle | TextConstants at: #';
  nextPutAll: familyName;
  nextPutAll: 'OLD put: oldStyle. TextConstants removeKey: #';
  nextPutAll: familyName;
  nextPutAll: ' ].';
  cr;
  nextPutAll: 'TextStyle collectionFromCompressedMIMEString: ';
  cr;
+ print: mime;
- print: mimeStream contents;
  nextPut: $.; cr; cr;
  nextPutAll: 'TextConstants at: #';
  nextPutAll: familyName;
  nextPutAll: 'OLD ifPresent: [ :oldStyle | TextStyle replaceStyle: oldStyle with: (TextStyle named: ''';
  nextPutAll: familyName;
  nextPutAll: ''') ].';
  cr;
  nextPutAll: 'TextStyle replaceFontsIn: (TextStyle looseFontsFromFamily: ''';
  nextPutAll: familyName;
  nextPutAll: ''') with: (TextStyle named: ''';
  nextPutAll: familyName;
  nextPutAll: ''').';
  cr ]).
 
  cs fileOut.
 
  !