#REFACTORING by stefan draft
authorStefan Vogel <sv@exept.de>
Wed, 11 Apr 2018 18:33:37 +0200
changeset 3554 01fa81669da2
parent 3553 31631af8baf9
child 3555 1ac9575a6015
#REFACTORING by stefan class: UIPainterView changed: #canMove: #canResize: #transaction:objects:do: #undoCreate: #forEach:do: replaced by #doIfNotNil:
UIPainterView.st
--- a/UIPainterView.st	Mon Apr 09 12:02:22 2018 +0200
+++ b/UIPainterView.st	Wed Apr 11 18:33:37 2018 +0200
@@ -2747,12 +2747,14 @@
      something can change their layout ( move, align, ... operation ).
     "
     something notNil ifTrue:[
-        self forEach:something do:[:aView|
+        something doIfNotNil:[:aView|
             (self canChangeLayoutOfView:aView) ifFalse:[^ false]
         ].
         ^ true
     ].
     ^ false
+
+    "Modified: / 11-04-2018 / 18:19:47 / stefan"
 !
 
 canMoveOrAlignSelection
@@ -2767,12 +2769,14 @@
      something can be resized."
 
     something notNil ifTrue:[
-        self forEach:something do:[:aView|
+        something doIfNotNil:[:aView|
             (self canResizeView:aView) ifFalse:[^ false]
         ].
         ^ true
     ].
     ^ false
+
+    "Modified: / 11-04-2018 / 18:20:09 / stefan"
 !
 
 canResizeSelection
@@ -2835,8 +2839,10 @@
      argument to the block is a view from derived from something
     "
     self withinTransaction:aType objects:something do:[
-	self forEach:something do:aOneArgBlock
+        something doIfNotNil:aOneArgBlock
     ]
+
+    "Modified: / 11-04-2018 / 18:20:27 / stefan"
 !
 
 withinTransaction:aType objects:objects do:aNoArgBlock
@@ -2951,9 +2957,11 @@
 !
 
 undoCreate:something
-    "undo method for creating or pasting an object
-    "
-    self forEach:something do:[:anId|self remove:(self findViewWithId:anId)].
+    "undo method for creating or pasting an object"
+
+    something doIfNotNil:[:anId|self remove:(self findViewWithId:anId)].
+
+    "Modified: / 11-04-2018 / 18:20:46 / stefan"
 !
 
 undoHistory