From 81ff0bc5eed057722f1052b8cbd923a4bb5e5ff6 Mon Sep 17 00:00:00 2001 From: OffrayLuna Date: Fri, 26 May 2017 08:51:57 +0000 Subject: [PATCH] Improving STON exporting, as recomended by Sven. --- src/Grafoscopio/GrafoscopioBrowser.class.st | 13 ------------- src/Grafoscopio/GrafoscopioNotebook.class.st | 13 +++++-------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/Grafoscopio/GrafoscopioBrowser.class.st b/src/Grafoscopio/GrafoscopioBrowser.class.st index ae1b7cc..d4e0b3c 100644 --- a/src/Grafoscopio/GrafoscopioBrowser.class.st +++ b/src/Grafoscopio/GrafoscopioBrowser.class.st @@ -265,19 +265,6 @@ GrafoscopioBrowser >> exportAsPdf [ http://xetex.sourceforge.net/' ]. ] -{ #category : #persistence } -GrafoscopioBrowser >> exportAsSton: aTree on: locator [ - | stonPrettyString | - aTree flatten. - stonPrettyString := String streamContents: [ :stream | - (STON writer on: stream) - newLine: String crlf; - prettyPrint: true; - keepNewLines: true; - nextPut: aTree children]. - locator nextPutAll: stonPrettyString -] - { #category : #'graphical interface' } GrafoscopioBrowser >> headerOn: constructor [ "Shows the body of a selected node" diff --git a/src/Grafoscopio/GrafoscopioNotebook.class.st b/src/Grafoscopio/GrafoscopioNotebook.class.st index 9c0aedc..089357d 100644 --- a/src/Grafoscopio/GrafoscopioNotebook.class.st +++ b/src/Grafoscopio/GrafoscopioNotebook.class.st @@ -192,15 +192,12 @@ GrafoscopioNotebook >> exportAsPDF [ { #category : #persistence } GrafoscopioNotebook >> exportAsSton: aNotebook on: aFileStream [ - | stonPrettyString | aNotebook flatten. - stonPrettyString := String streamContents: [ :stream | - (STON writer on: stream) - newLine: String crlf; - prettyPrint: true; - keepNewLines: true; - nextPut: aNotebook children]. - aFileStream nextPutAll: stonPrettyString + (STON writer on: aFileStream) + newLine: String crlf; + prettyPrint: true; + keepNewLines: true; + nextPut: aNotebook children ] { #category : #persistence }