diff options
Diffstat (limited to 'src/Fl_Tree.cxx')
| -rw-r--r-- | src/Fl_Tree.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Fl_Tree.cxx b/src/Fl_Tree.cxx index 0cd69904d..53dcbe515 100644 --- a/src/Fl_Tree.cxx +++ b/src/Fl_Tree.cxx @@ -997,11 +997,9 @@ void Fl_Tree::clear_children(Fl_Tree_Item *item) { /// \see item_pathname() /// Fl_Tree_Item *Fl_Tree::find_item(const char *path) { - if ( ! _root ) return(NULL); - char **arr = parse_path(path); - Fl_Tree_Item *item = _root->find_item(arr); - free_path(arr); - return(item); + // I evoke "Effective C++, 3rd Ed", p.23. Sola fide, Amen. + return(const_cast<Fl_Tree_Item*>( + static_cast<const Fl_Tree&>(*this).find_item(path))); } /// A const version of Fl_Tree::find_item(const char *path) |
