changed:
authorClaus Gittinger <cg@exept.de>
Thu, 18 Aug 2011 02:19:34 +0200
changeset 2853 1eadca551eed
parent 2852 a3007ba3b216
child 2854 459153442565
changed: #addSpec:builder:in:beforeIndex: #updateFromSpec: allow empty id
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'!