fix new_prop_string() when doing a name change on multiple selected instances
This commit is contained in:
parent
5ffc7bb5e4
commit
9ecc5859b2
|
|
@ -1443,9 +1443,11 @@ static int update_symbol(const char *result, int x, int first_sel)
|
|||
if(!pushed) { xctx->push_undo(); pushed=1;}
|
||||
if(!k) hash_names(-1, XINSERT);
|
||||
hash_names(*ii, XDELETE);
|
||||
dbg(1, "update_symbol(): delete %s\n", xctx->inst[*ii].instname);
|
||||
new_prop_string(*ii, ptr, k, /* sets also inst[].instname */
|
||||
tclgetboolvar("disable_unique_names")); /* set new prop_ptr */
|
||||
hash_names(*ii, XINSERT);
|
||||
dbg(1, "update_symbol(): insert %s\n", xctx->inst[*ii].instname);
|
||||
}
|
||||
set_inst_flags(&xctx->inst[*ii]);
|
||||
/* set cached flags in instances */
|
||||
|
|
|
|||
|
|
@ -750,6 +750,7 @@ void new_prop_string(int i, const char *old_prop, int fast, int dis_uniq_names)
|
|||
|
||||
if(old_name==NULL) {
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, old_prop); /* changed to copy old props if no name */
|
||||
my_strdup2(_ALLOC_ID_, &xctx->inst[i].instname, "");
|
||||
return;
|
||||
}
|
||||
/* don't change old_prop if name does not conflict. */
|
||||
|
|
@ -757,6 +758,7 @@ void new_prop_string(int i, const char *old_prop, int fast, int dis_uniq_names)
|
|||
is_used = name_is_used(old_name, "", "", -1);
|
||||
if(dis_uniq_names || is_used == -1 || is_used == i) {
|
||||
my_strdup(_ALLOC_ID_, &xctx->inst[i].prop_ptr, old_prop);
|
||||
my_strdup2(_ALLOC_ID_, &xctx->inst[i].instname, old_name);
|
||||
my_free(_ALLOC_ID_, &old_name);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue