class: DeviceWorkstation
authorClaus Gittinger <cg@exept.de>
Sun, 01 Sep 2013 12:51:01 +0200
changeset 6130 494a954d3215
parent 6129 d83e9ee7e063
child 6131 3d27be935360
class: DeviceWorkstation changed: #bufferAsString: #copyBufferAsString
DeviceWorkstation.st
--- a/DeviceWorkstation.st	Sun Sep 01 12:08:52 2013 +0200
+++ b/DeviceWorkstation.st	Sun Sep 01 12:51:01 2013 +0200
@@ -571,24 +571,25 @@
     "aBuffer (my current selection) as a string"
 
     aBuffer isString ifTrue:[
-	^ aBuffer string.
+        ^ aBuffer string.
     ].
 
     aBuffer isNil ifTrue:[
-	^ ''
+        ^ ''
     ].
 
     aBuffer isStringCollection ifTrue:[
-	^ aBuffer
-	    from:1
-	    to:aBuffer size
-	    asStringWith:Character cr
-	    compressTabs:false
-	    final:nil
-	    withEmphasis:false.
-    ].
-
-    RecursiveStoreError handle:[:ex |
+        ^ aBuffer
+            from:1
+            to:aBuffer size
+            asStringWith:Character cr
+            compressTabs:false
+            final:nil
+            withEmphasis:false.
+    ].
+
+    Error handle:[:ex |
+        Transcript showCR:'error while converting copyBuffer to string: ',ex description.
        ^ ''
     ] do:[
        ^ aBuffer storeString
@@ -3168,15 +3169,7 @@
 copyBufferAsString
     "return my current selection as a string"
 
-    |copyBufferContents s|
-
-    copyBufferContents := self getCopyBuffer.
-    copyBufferContents isString ifFalse:[
-        s := copyBufferContents class nameWithArticle.
-        Transcript showCR:'invalid object in copyBuffer: ',s.
-        ^ s.
-    ].
-    ^ self class bufferAsString:copyBufferContents.
+    ^ self class bufferAsString:self getCopyBuffer.
 !
 
 getClipboardObjectFor:drawableId
@@ -8256,11 +8249,11 @@
 !DeviceWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.591 2013-09-01 10:08:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.592 2013-09-01 10:51:01 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.591 2013-09-01 10:08:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.592 2013-09-01 10:51:01 cg Exp $'
 ! !