summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>1999-02-19 16:21:50 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>1999-02-19 16:21:50 +0000
commitb737731013bcefbe55fca9b1f085b07c4af71652 (patch)
tree48eb293c58320acd74e00093756fc73a0d2cdd25
parent1a135b04249a6747ba023af915b6586bef4b41fb (diff)
Fixed array_name() bug - now correctly handles arrays in different classes
with the same name. git-svn-id: file:///fltk/svn/fltk/trunk@308 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--fluid/Fl_Widget_Type.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx
index bda1ab10b..ed623d337 100644
--- a/fluid/Fl_Widget_Type.cxx
+++ b/fluid/Fl_Widget_Type.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Widget_Type.cxx,v 1.14 1999/01/13 15:53:57 mike Exp $"
+// "$Id: Fl_Widget_Type.cxx,v 1.15 1999/02/19 16:21:50 mike Exp $"
//
// Widget type code for the Fast Light Tool Kit (FLTK).
//
@@ -1168,7 +1168,11 @@ const char *array_name(Fl_Widget_Type *o) {
}
int num = atoi(d+1);
int sawthis = 0;
- for (Fl_Type *t = Fl_Type::first; t; t = t->next) {
+ Fl_Type *t = o->prev;
+ Fl_Type *tp = o;
+ const char *cn = o->class_name();
+ for (; t && t->class_name() == cn; tp = t, t = t->prev);
+ for (t = tp; t && t->class_name() == cn; t = t->next) {
if (t == o) {sawthis=1; continue;}
const char *e = t->name();
if (!e) continue;
@@ -1701,5 +1705,5 @@ int Fl_Widget_Type::read_fdesign(const char* name, const char* value) {
}
//
-// End of "$Id: Fl_Widget_Type.cxx,v 1.14 1999/01/13 15:53:57 mike Exp $".
+// End of "$Id: Fl_Widget_Type.cxx,v 1.15 1999/02/19 16:21:50 mike Exp $".
//