# HG changeset patch # User Claus Gittinger # Date 1313626774 -7200 # Node ID 1eadca551eed860f1eea1703d3254a031ba70e4f # Parent a3007ba3b216f21c3dc84352e5c920d9aa2bcd9f changed: #addSpec:builder:in:beforeIndex: #updateFromSpec: allow empty id diff -r a3007ba3b216 -r 1eadca551eed UIPainterView.st --- a/UIPainterView.st Tue Aug 16 18:20:52 2011 +0200 +++ b/UIPainterView.st Thu Aug 18 02:19:34 2011 +0200 @@ -2436,11 +2436,18 @@ ]. nameOfSpec := copyOfSpec name. - - (nameOfSpec isNil or:[(self propertyOfName:nameOfSpec) notNil]) ifTrue:[ - copyOfSpec name:(nameOfSpec := self uniqueNameFor:copyOfSpec) + "/ old: enforce a name + "/ (nameOfSpec isNil or:[(self propertyOfName:nameOfSpec) notNil]) ifTrue:[ + "/ copyOfSpec name:(nameOfSpec := self uniqueNameFor:copyOfSpec) + "/ ]. + "/ aView name:nameOfSpec. + "/ new: + (nameOfSpec isNil "notEmptyOrNil" or:[ (self propertyOfName:nameOfSpec) notNil]) ifTrue:[ + copyOfSpec name:(nameOfSpec := self uniqueNameFor:copyOfSpec). + aView name:nameOfSpec. ]. - aView name:nameOfSpec. + "/ end + treeView addProperty:newProperty beforeIndex:beforeIndex. ]. @@ -2456,7 +2463,7 @@ ]. ^ newView - "Modified: 4.7.1997 / 23:48:55 / cg" + "Modified: / 17-08-2011 / 13:56:24 / cg" ! fullSpecFor:aView @@ -2598,15 +2605,18 @@ self singleSelection notNil ifTrue:[ self withSelectionHiddenDo:[ self transaction:#specification selectionDo:[:aView| + props := self propertyOfView:aView. name := (aSpec name) withoutSeparators. - (name = props name) ifFalse:[ - (self propertyOfName:name) notNil ifTrue:[ - name := props name - ] + name isNil ifTrue:[ + "/ not yet given a name + (name ~= props name) ifTrue:[ + (self propertyOfName:name) notNil ifTrue:[ + name := props name + ] + ]. ]. - aSpec name:name. self createUndoSpecModify:props. self rebuildView:aView fromSpec:aSpec withBuilder:nil. @@ -2616,7 +2626,8 @@ ] ] - "Modified: / 30.10.2001 / 13:59:45 / cg" + "Modified: / 17-08-2011 / 13:56:38 / cg" + "Modified (format): / 18-08-2011 / 02:19:01 / cg" ! ! !UIPainterView methodsFor:'testing'!