# HG changeset patch # User Stefan Vogel # Date 1523464417 -7200 # Node ID 01fa81669da27c45811c99cad0f49c92725c7d85 # Parent 31631af8baf9d69d93ea450e02df04d239ff87a4 #REFACTORING by stefan class: UIPainterView changed: #canMove: #canResize: #transaction:objects:do: #undoCreate: #forEach:do: replaced by #doIfNotNil: diff -r 31631af8baf9 -r 01fa81669da2 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