diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-26 16:07:54 +0100 |
commit | 5afe88df2538274859a162ffd63ed52118e80c19 (patch) | |
tree | b610dfd58dc748fd63f49565b2a43eea2316714f /src/gui/widgets/tabbedarea.cpp | |
parent | 73ba2a95f5bd4a0dd09af52d5864800be2b0a4c6 (diff) | |
download | mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.gz mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.bz2 mana-5afe88df2538274859a162ffd63ed52118e80c19.tar.xz mana-5afe88df2538274859a162ffd63ed52118e80c19.zip |
Apply C++11 fixits
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
Diffstat (limited to 'src/gui/widgets/tabbedarea.cpp')
-rw-r--r-- | src/gui/widgets/tabbedarea.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 52690657..cd2c0f03 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -41,7 +41,7 @@ TabbedArea::TabbedArea() : gcn::TabbedArea(), add(mArrowButton[0]); add(mArrowButton[1]); - widgetResized(NULL); + widgetResized(nullptr); } int TabbedArea::getNumberOfTabs() const @@ -51,7 +51,7 @@ int TabbedArea::getNumberOfTabs() const Tab *TabbedArea::getTab(const std::string &name) const { - TabContainer::const_iterator itr = mTabs.begin(), itr_end = mTabs.end(); + auto itr = mTabs.begin(), itr_end = mTabs.end(); while (itr != itr_end) { if ((*itr).first->getCaption() == name) @@ -59,7 +59,7 @@ Tab *TabbedArea::getTab(const std::string &name) const ++itr; } - return NULL; + return nullptr; } void TabbedArea::draw(gcn::Graphics *graphics) @@ -72,7 +72,7 @@ void TabbedArea::draw(gcn::Graphics *graphics) gcn::Widget *TabbedArea::getWidget(const std::string &name) const { - TabContainer::const_iterator itr = mTabs.begin(), itr_end = mTabs.end(); + auto itr = mTabs.begin(), itr_end = mTabs.end(); while (itr != itr_end) { if ((*itr).first->getCaption() == name) @@ -81,7 +81,7 @@ gcn::Widget *TabbedArea::getWidget(const std::string &name) const ++itr; } - return NULL; + return nullptr; } gcn::Widget *TabbedArea::getCurrentWidget() @@ -89,7 +89,7 @@ gcn::Widget *TabbedArea::getCurrentWidget() if (gcn::Tab *tab = getSelectedTab()) return getWidget(tab->getCaption()); - return NULL; + return nullptr; } void TabbedArea::addTab(gcn::Tab* tab, gcn::Widget* widget) @@ -119,7 +119,7 @@ void TabbedArea::removeTab(Tab *tab) if (getNumberOfTabs() > 1) setSelectedTab(std::max(0, getSelectedTabIndex() - 1)); else - mSelectedTab = 0; + mSelectedTab = nullptr; } TabContainer::iterator iter; @@ -163,7 +163,7 @@ void TabbedArea::mousePressed(gcn::MouseEvent &mouseEvent) { gcn::Widget *widget = mTabContainer->getWidgetAt(mouseEvent.getX(), mouseEvent.getY()); - gcn::Tab *tab = dynamic_cast<gcn::Tab*>(widget); + auto *tab = dynamic_cast<gcn::Tab*>(widget); if (tab) { @@ -180,7 +180,7 @@ void TabbedArea::setSelectedTab(gcn::Tab *tab) if (Tab *newTab = dynamic_cast<Tab*>(tab)) newTab->setCurrent(); - widgetResized(NULL); + widgetResized(nullptr); } void TabbedArea::widgetResized(const gcn::Event &event) |