summaryrefslogtreecommitdiff
path: root/fluid/Fl_Type.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-10-19 23:54:31 +0200
committerMatthias Melcher <github@matthiasm.com>2023-10-19 23:54:37 +0200
commitea88888f768b1bbec2300eea93029bec67ad2f43 (patch)
treed0120b8f88a48a342616b7aedcf05aeb326f56ce /fluid/Fl_Type.cxx
parent450248d20e8827665a901a02c344ad435aea336d (diff)
FLUID typos, comments, superfluous code
Diffstat (limited to 'fluid/Fl_Type.cxx')
-rw-r--r--fluid/Fl_Type.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx
index 379c4cb90..4732b00e0 100644
--- a/fluid/Fl_Type.cxx
+++ b/fluid/Fl_Type.cxx
@@ -427,7 +427,7 @@ Fl_Group_Type *Fl_Type::group() {
if (!is_widget())
return NULL;
for (Fl_Type *t = this; t; t=t->parent)
- if (t->is_group())
+ if (t->is_a(Fl_Type::ID_Group))
return (Fl_Group_Type*)t;
return NULL;
}
@@ -882,17 +882,16 @@ const char* Fl_Type::class_name(const int need_nest) const {
}
/**
- If this Type resides inside a class, this function returns the class type, or null.
+ Check if this is inside a Fl_Class_Type or Fl_Widget_Class_Type.
+ \return true if any of the parents is Fl_Class_Type or Fl_Widget_Class_Type
*/
-const Fl_Class_Type *Fl_Type::is_in_class() const {
+bool Fl_Type::is_in_class() const {
Fl_Type* p = parent;
while (p) {
- if (p->is_class()) {
- return (Fl_Class_Type*)p;
- }
+ if (p->is_class()) return true;
p = p->parent;
}
- return 0;
+ return false;
}
void Fl_Type::write_static(Fd_Code_Writer&) {