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
|
||||
|
||||
- (add new items here)
|
||||
- Duplicating Widget Class in Fluid no longer crashes (STR #3445).
|
||||
- Fl_Check_Browser::add(item) now accepts NULL (STR #3498).
|
||||
- Interface to set maximum width of spinner text field (STR #3386).
|
||||
- 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;
|
||||
// find the parent widget:
|
||||
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);
|
||||
force_parent = 0;
|
||||
|
||||
|
@ -1116,8 +1116,14 @@ Fl_Type *Fl_Type_make(const char *tn) {
|
||||
Fl_Menu_Item *m = New_Menu+i;
|
||||
if (!m->user_data()) continue;
|
||||
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->alt_type_name())) {r = t->make(); break;}
|
||||
if (!fl_ascii_strcasecmp(tn,t->type_name())) {
|
||||
r = t->make();
|
||||
break;
|
||||
}
|
||||
if (!fl_ascii_strcasecmp(tn,t->alt_type_name())) {
|
||||
r = t->make();
|
||||
break;
|
||||
}
|
||||
}
|
||||
reading_file = 0;
|
||||
return r;
|
||||
|
@ -450,40 +450,44 @@ static void read_children(Fl_Type *p, int paste) {
|
||||
goto CONTINUE;
|
||||
}
|
||||
|
||||
{Fl_Type *t = Fl_Type_make(c);
|
||||
if (!t) {
|
||||
read_error("Unknown word \"%s\"", c);
|
||||
continue;
|
||||
}
|
||||
t->name(read_word());
|
||||
{
|
||||
Fl_Type *t = Fl_Type_make(c);
|
||||
if (!t) {
|
||||
read_error("Unknown word \"%s\"", c);
|
||||
continue;
|
||||
}
|
||||
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);
|
||||
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;
|
||||
|
||||
CONTINUE:;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user