From a0b5f5fee9809670c2c9cf9b1f63ab2be11fd9fd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 24 May 2011 02:54:01 +0300 Subject: Fix leaks in client, skilldialog and playerinfo classes. --- src/gui/widgets/tabbedarea.cpp | 14 ++++++++++++++ src/gui/widgets/tabbedarea.h | 4 ++++ 2 files changed, 18 insertions(+) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index da6dfb64c..6c2ef5b25 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -428,6 +428,20 @@ void TabbedArea::updateArrowEnableState() } } +Tab *TabbedArea::getTabByIndex(int index) const +{ + if (index < 0 || index >= static_cast(mTabs.size())) + return 0; + return static_cast(mTabs[index].first); +} + +gcn::Widget *TabbedArea::getWidgetByIndex(int index) const +{ + if (index < 0 || index >= static_cast(mTabs.size())) + return 0; + return mTabs[index].second; +} + /* void TabbedArea::moveLeft(gcn::Tab *tab) { diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index 00c1aaf23..dccf72357 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -70,6 +70,10 @@ class TabbedArea : public gcn::TabbedArea, public gcn::WidgetListener */ Tab *getTab(const std::string &name) const; + Tab *getTabByIndex(int index) const; + + gcn::Widget *getWidgetByIndex(int index) const; + /** * Returns the widget with the tab that has specified caption */ -- cgit v1.2.3-70-g09d2