#REFACTORING by stefan
authorStefan Vogel <sv@exept.de>
Wed, 11 Apr 2018 18:34:32 +0200
changeset 3555 1ac9575a6015
parent 3554 01fa81669da2
child 3556 5513f508bcf2
#REFACTORING by stefan class: UIObjectView changed: #endResize #selectionDo: #setSelection:withRedraw: #showUnselected: #forEach:do: replaced by #doIfNotNil:
UIObjectView.st
--- a/UIObjectView.st	Wed Apr 11 18:33:37 2018 +0200
+++ b/UIObjectView.st	Wed Apr 11 18:34:32 2018 +0200
@@ -1058,7 +1058,7 @@
     "/ therefore, we hide the handles while this is possibly done.
     "/ however, to avoid flicker, we check for containers first.
     anyLayoutWrapper := anyTransparentBox := false.
-    self forEach:object do:[:aViewOrComponent | 
+    object doIfNotNil:[:aViewOrComponent | 
         aViewOrComponent isLayoutWrapper ifTrue:[ anyLayoutWrapper := true ].
         aViewOrComponent isTransparentBox ifTrue:[ anyTransparentBox := true ].
     ].
@@ -1085,7 +1085,7 @@
             self windowGroup processExposeEvents
         ].
 
-        self forEach:savedSelection do:[:aView |
+        savedSelection doIfNotNil:[:aView |
             self recomputeShapeIfTransparentBox:aView.
         ].
 
@@ -1094,6 +1094,8 @@
 
     self layoutChanged.
     self setDefaultActions.
+
+    "Modified: / 11-04-2018 / 18:18:08 / stefan"
 !
 
 layoutChanged
@@ -1583,11 +1585,11 @@
 !
 
 selectionDo:aBlock
-    "apply block to every selected object
-    "
-    self forEach:(self selection) do:aBlock
-
-
+    "apply block to every selected object"
+
+    self selection doIfNotNil:aBlock
+
+    "Modified: / 11-04-2018 / 18:18:32 / stefan"
 !
 
 showSelection
@@ -1796,7 +1798,7 @@
         self hideSelection.
         selection := sel.
 
-        self forEach:selection do:[:aView |
+        selection doIfNotNil:[:aView |
             |superView|
 
             superView := aView superView. 
@@ -1806,6 +1808,8 @@
     ] ifFalse:[
         selection := sel
     ]
+
+    "Modified: / 11-04-2018 / 18:18:50 / stefan"
 !
 
 showUnselected:something
@@ -1819,7 +1823,7 @@
 
     damages := OrderedCollection new.
 
-    self forEach:something do:[:v|
+    something doIfNotNil:[:v|
         self handlesOf:v do:[:aDamage :wht|
             damages reverseDo:[:el|
                 (el intersects:aDamage) ifTrue:[
@@ -1856,6 +1860,8 @@
     ] ensure:[
         selection := savedSelection
     ].
+
+    "Modified: / 11-04-2018 / 18:19:11 / stefan"
 ! !
 
 !UIObjectView methodsFor:'testing'!