changed:
#addSpec:builder:in:beforeIndex:
#updateFromSpec:
allow empty id
--- 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'!