From b737731013bcefbe55fca9b1f085b07c4af71652 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Fri, 19 Feb 1999 16:21:50 +0000 Subject: 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 --- fluid/Fl_Widget_Type.cxx | 10 +++++++--- 1 file 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 $". // -- cgit v1.2.3