STR #3445: Duplicating Widget Class in Fluid no longer crashes.
This commit is contained in:
parent
aa6d9b74c6
commit
2b6347d0bd
@ -145,6 +145,7 @@ Changes in FLTK 1.4.0 Released: ??? ?? 2019
|
|||||||
Bug Fixes
|
Bug Fixes
|
||||||
|
|
||||||
- (add new items here)
|
- (add new items here)
|
||||||
|
- Duplicating Widget Class in Fluid no longer crashes (STR #3445).
|
||||||
- Fl_Check_Browser::add(item) now accepts NULL (STR #3498).
|
- Fl_Check_Browser::add(item) now accepts NULL (STR #3498).
|
||||||
- Interface to set maximum width of spinner text field (STR #3386).
|
- Interface to set maximum width of spinner text field (STR #3386).
|
||||||
- Fl_Text_Display no longer wiggles (STR #2531).
|
- Fl_Text_Display no longer wiggles (STR #2531).
|
||||||
|
@ -102,7 +102,7 @@ Fl_Type *Fl_Widget_Type::make() {
|
|||||||
Fl_Widget_Type* q = (Fl_Widget_Type*)qq;
|
Fl_Widget_Type* q = (Fl_Widget_Type*)qq;
|
||||||
// find the parent widget:
|
// find the parent widget:
|
||||||
Fl_Widget_Type* p = q;
|
Fl_Widget_Type* p = q;
|
||||||
if ((force_parent || !p->is_group()) && p->parent->is_widget())
|
if ((force_parent || !p->is_group()) && p->parent && p->parent->is_widget())
|
||||||
p = (Fl_Widget_Type*)(p->parent);
|
p = (Fl_Widget_Type*)(p->parent);
|
||||||
force_parent = 0;
|
force_parent = 0;
|
||||||
|
|
||||||
|
@ -1116,8 +1116,14 @@ Fl_Type *Fl_Type_make(const char *tn) {
|
|||||||
Fl_Menu_Item *m = New_Menu+i;
|
Fl_Menu_Item *m = New_Menu+i;
|
||||||
if (!m->user_data()) continue;
|
if (!m->user_data()) continue;
|
||||||
Fl_Type *t = (Fl_Type*)(m->user_data());
|
Fl_Type *t = (Fl_Type*)(m->user_data());
|
||||||
if (!fl_ascii_strcasecmp(tn,t->type_name())) {r = t->make(); break;}
|
if (!fl_ascii_strcasecmp(tn,t->type_name())) {
|
||||||
if (!fl_ascii_strcasecmp(tn,t->alt_type_name())) {r = t->make(); break;}
|
r = t->make();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!fl_ascii_strcasecmp(tn,t->alt_type_name())) {
|
||||||
|
r = t->make();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
reading_file = 0;
|
reading_file = 0;
|
||||||
return r;
|
return r;
|
||||||
|
@ -450,40 +450,44 @@ static void read_children(Fl_Type *p, int paste) {
|
|||||||
goto CONTINUE;
|
goto CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
{Fl_Type *t = Fl_Type_make(c);
|
{
|
||||||
if (!t) {
|
Fl_Type *t = Fl_Type_make(c);
|
||||||
read_error("Unknown word \"%s\"", c);
|
if (!t) {
|
||||||
continue;
|
read_error("Unknown word \"%s\"", c);
|
||||||
}
|
continue;
|
||||||
t->name(read_word());
|
}
|
||||||
|
t->name(read_word());
|
||||||
|
|
||||||
c = read_word(1);
|
|
||||||
if (strcmp(c,"{") && t->is_class()) { // <prefix> <name>
|
|
||||||
((Fl_Class_Type*)t)->prefix(t->name());
|
|
||||||
t->name(c);
|
|
||||||
c = read_word(1);
|
c = read_word(1);
|
||||||
|
if (strcmp(c,"{") && t->is_class()) { // <prefix> <name>
|
||||||
|
((Fl_Class_Type*)t)->prefix(t->name());
|
||||||
|
t->name(c);
|
||||||
|
c = read_word(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcmp(c,"{")) {
|
||||||
|
read_error("Missing property list for %s\n",t->title());
|
||||||
|
goto REUSE_C;
|
||||||
|
}
|
||||||
|
|
||||||
|
t->open_ = 0;
|
||||||
|
for (;;) {
|
||||||
|
const char *cc = read_word();
|
||||||
|
if (!cc || !strcmp(cc,"}")) break;
|
||||||
|
t->read_property(cc);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!t->is_parent()) continue;
|
||||||
|
c = read_word(1);
|
||||||
|
if (strcmp(c,"{")) {
|
||||||
|
read_error("Missing child list for %s\n",t->title());
|
||||||
|
goto REUSE_C;
|
||||||
|
}
|
||||||
|
read_children(t, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(c,"{")) {
|
|
||||||
read_error("Missing property list for %s\n",t->title());
|
|
||||||
goto REUSE_C;
|
|
||||||
}
|
|
||||||
|
|
||||||
t->open_ = 0;
|
|
||||||
for (;;) {
|
|
||||||
const char *cc = read_word();
|
|
||||||
if (!cc || !strcmp(cc,"}")) break;
|
|
||||||
t->read_property(cc);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!t->is_parent()) continue;
|
|
||||||
c = read_word(1);
|
|
||||||
if (strcmp(c,"{")) {
|
|
||||||
read_error("Missing child list for %s\n",t->title());
|
|
||||||
goto REUSE_C;
|
|
||||||
}
|
|
||||||
read_children(t, 0);}
|
|
||||||
Fl_Type::current = p;
|
Fl_Type::current = p;
|
||||||
|
|
||||||
CONTINUE:;
|
CONTINUE:;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user