Skip to content

Commit

Permalink
Fluid: Improve UID generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasWM committed Dec 28, 2024
1 parent efb4e17 commit c1f4134
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fluid/Fl_Type.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,9 @@ void Fl_Type::add(Fl_Type *anchor, Strategy strategy) {
}

#ifdef FLUID_OPTION_MERGEBACK
if ( g_project.write_mergeback_data
&& strategy.source() == Strategy::FROM_USER)
{ // make sure that we have no duplicate uid's
// FIXME: if 'add' is called while loading a file, the UID will be set by the tag later
Fl_Type *tp = this;
do {
tp->set_uid(tp->uid_);
Expand Down Expand Up @@ -759,7 +760,7 @@ void Fl_Type::insert(Fl_Type *g) {
g->prev = end;
update_visibility_flag(this);
#ifdef FLUID_OPTION_MERGEBACK
{ // make sure that we have no duplicate uid's
if (g_project.write_mergeback_data) { // make sure that we have no duplicate uid's
Fl_Type *tp = this;
do {
tp->set_uid(tp->uid_);
Expand Down
2 changes: 2 additions & 0 deletions fluid/file.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ Fl_Type *Fd_Project_Reader::read_children(Fl_Type *p, int merge, Strategy strate
if (!cc || !strcmp(cc,"}")) break;
t->read_property(*this, cc);
}
if (g_project.write_mergeback_data && t->get_uid()==0)
t->set_uid(0);

if (t->can_have_children()) {
c = read_word(1);
Expand Down

0 comments on commit c1f4134

Please sign in to comment.