The Trunk: Graphics-nice.295.mcz

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

The Trunk: Graphics-nice.295.mcz

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

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

Name: Graphics-nice.295
Author: nice
Time: 17 July 2014, 11:53:05.367 pm
UUID: 9fb8a437-18ff-4ae6-adc8-71c70db3b083
Ancestors: Graphics-nice.294

Answer to my own question: why do we need to return a ReadWriteStream from compressedMIMEEncodedStream?
We don't. We need a ReadStream.
But since it's just for getting its contents, we do not need a Stream at all, just a String...

The sole usage is in System and will be changed right after this one.

=============== Diff against Graphics-nice.294 ===============

Item was added:
+ ----- Method: TextStyle>>compressedMIMEEncoded (in category 'mime file in/out') -----
+ compressedMIMEEncoded
+ "Answer a String with my compressed, stored representation as Base64"
+
+ | s ff |
+ self fontArray do: [:f | f releaseCachedState].
+ s := RWBinaryOrTextStream on: ''.
+ ff := SmartRefStream on: s reset.
+ TextConstants at: #forceFontWriting put: true.
+ [ff nextPut: self]
+ ensure: [TextConstants at: #forceFontWriting put: false].
+ ^s contents asByteArray zipped base64Encoded!

Item was removed:
- ----- Method: TextStyle>>compressedMIMEEncodedStream (in category 'mime file in/out') -----
- compressedMIMEEncodedStream
- "Answer a ReadWriteStream with my compressed, stored representation as Base64"
-
- | s ff ffcontents |
- self fontArray do: [:f | f releaseCachedState].
- s := RWBinaryOrTextStream on: ''.
- ff := SmartRefStream on: s reset.
- TextConstants at: #forceFontWriting put: true.
- [ff nextPut: self]
- ensure: [TextConstants at: #forceFontWriting put: false].
- ffcontents := s contents.
- s := RWBinaryOrTextStream with: ffcontents asByteArray zipped base64Encoded.
- ^s
- ascii;
- reset;
- yourself!