MenuEditor.st
changeset 912 931b23146b3d
parent 902 f510032000ad
child 916 ec057a5e0efc
--- a/MenuEditor.st	Wed Jul 22 21:12:11 1998 +0200
+++ b/MenuEditor.st	Thu Jul 23 16:13:10 1998 +0200
@@ -2773,10 +2773,11 @@
 !MenuEditor::TreeView methodsFor:'menus'!
 
 doCopy
+    |clip|
 
     self hasSelection ifTrue:[
-        self application clipboard: OrderedCollection new.
-        self selectionDo:[:i| self application clipboard add:((listOfNodes at:i) copy)].
+        self application clipboard:(clip := OrderedCollection new).
+        self selectionDo:[:i | clip add:((listOfNodes at:i) copy)].
         self topView application updateAllToolInstances.
     ]
 !
@@ -2814,8 +2815,10 @@
 !
 
 doCut
-
-    (self topView application hasValidSelection value and: [self askForItemModification])
+    |app|
+
+    app := self topView application.
+    (app hasValidSelection value and: [self askForItemModification])
     ifTrue:
     [
         |selectedNodes|
@@ -2824,7 +2827,7 @@
         self selectedNodesRemove.
         self selection: selectedNodes first - 1.
         self setModified.
-        self topView application updateAllToolInstances.
+        app updateAllToolInstances.
     ]
 
 !
@@ -2844,9 +2847,11 @@
 !
 
 doPaste
-
-    (self application clipboard notNil and:[self selectedNode notNil]) ifTrue:[
-        self addElement:(self application clipboard collect:[:el| el copy])
+    |clip|
+
+    clip := self application clipboard.
+    (clip notNil and:[self selectedNode notNil]) ifTrue:[
+        self addElement:(clip collect:[:el| el copy])
     ].
 ! !
 
@@ -2921,10 +2926,10 @@
 !
 
 setModified 
-
-    self topView application modified: true.
-
-    self topView application updateChannels
+    |app|
+
+    (app := self topView application) modified: true.
+    app updateChannels
 ! !
 
 !MenuEditor class methodsFor:'documentation'!