Skip to content

Commit

Permalink
Added missing non-const versions of find_clicked()
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10072 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
erco77 committed Jan 21, 2014
1 parent abdc834 commit 9ba8793
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Fl_Tree.cxx
Expand Up @@ -1120,6 +1120,12 @@ const Fl_Tree_Item* Fl_Tree::find_clicked(int yonly) const {
if ( ! _root ) return(NULL);
return(_root->find_clicked(_prefs, yonly));
}

Fl_Tree_Item *Fl_Tree::find_clicked(int yonly) {
// "Effective C++, 3rd Ed", p.23. Sola fide, Amen.
return(const_cast<Fl_Tree_Item*>(
static_cast<const Fl_Tree&>(*this).find_clicked(yonly)));
}
#else
/// Find the item that was last clicked on.
/// You should use callback_item() instead, which is fast,
Expand All @@ -1138,6 +1144,11 @@ const Fl_Tree_Item* Fl_Tree::find_clicked() const {
if ( ! _root ) return(NULL);
return(_root->find_clicked(_prefs));
}
Fl_Tree_Item *Fl_Tree::find_clicked() {
// "Effective C++, 3rd Ed", p.23. Sola fide, Amen.
return(const_cast<Fl_Tree_Item*>(
static_cast<const Fl_Tree&>(*this).find_clicked()));
}
#endif

/// Set the item that was last clicked.
Expand Down

0 comments on commit 9ba8793

Please sign in to comment.