summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-08-21 22:44:29 +0300
committerAndrei Karas <akaras@inbox.ru>2017-08-21 22:45:15 +0300
commit42f47e483da19079a937c4801ca94bd62d8dc970 (patch)
tree56dc96737e01e04d54357ce7118de3a1f000c516 /src/gui/widgets
parent2d8b9246c8003f1d32ba396bc19cc11bc5a595b2 (diff)
downloadplus-42f47e483da19079a937c4801ca94bd62d8dc970.tar.gz
plus-42f47e483da19079a937c4801ca94bd62d8dc970.tar.bz2
plus-42f47e483da19079a937c4801ca94bd62d8dc970.tar.xz
plus-42f47e483da19079a937c4801ca94bd62d8dc970.zip
Remove useless else.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/attrs/attrdisplay.h3
-rw-r--r--src/gui/widgets/button.cpp3
-rw-r--r--src/gui/widgets/guitable.cpp13
-rw-r--r--src/gui/widgets/itemcontainer.cpp3
-rw-r--r--src/gui/widgets/setupitem.cpp3
-rw-r--r--src/gui/widgets/tabbedarea.cpp9
-rw-r--r--src/gui/widgets/textbox.cpp6
-rw-r--r--src/gui/widgets/widget2.h3
8 files changed, 14 insertions, 29 deletions
diff --git a/src/gui/widgets/attrs/attrdisplay.h b/src/gui/widgets/attrs/attrdisplay.h
index 1641bac9f..f682e41f5 100644
--- a/src/gui/widgets/attrs/attrdisplay.h
+++ b/src/gui/widgets/attrs/attrdisplay.h
@@ -56,8 +56,7 @@ class AttrDisplay notfinal : public Container
{
if (mValue == nullptr)
return "-";
- else
- return mValue->getCaption();
+ return mValue->getCaption();
}
const std::string &getShortName() const
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 3509b927c..df46014a3 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -880,8 +880,7 @@ bool Button::isPressed() const
{
if (mMousePressed)
return mHasMouse;
- else
- return mKeyPressed;
+ return mKeyPressed;
}
void Button::focusLost(const Event& event A_UNUSED)
diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp
index 9ff2075b1..4a0f88246 100644
--- a/src/gui/widgets/guitable.cpp
+++ b/src/gui/widgets/guitable.cpp
@@ -608,13 +608,10 @@ Widget *GuiTable::getWidgetAt(int x, int y)
if (row > -1 && column > -1)
{
Widget *const w = mModel->getElementAt(row, column);
- if ((w != nullptr) && w->isFocusable())
+ if (w != nullptr && w->isFocusable())
return w;
- else
- return nullptr; // Grab the event locally
}
- else
- return nullptr;
+ return nullptr;
}
int GuiTable::getRowForY(const int y) const
@@ -627,8 +624,7 @@ int GuiTable::getRowForY(const int y) const
if (row < 0 || row >= mModel->getRows())
return -1;
- else
- return row;
+ return row;
}
int GuiTable::getColumnForX(const int x) const
@@ -646,8 +642,7 @@ int GuiTable::getColumnForX(const int x) const
if (column < 0 || column >= colnum)
return -1;
- else
- return column;
+ return column;
}
void GuiTable::setFocusHandler(FocusHandler *const focusHandler)
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 4b70c86b7..3d5c3829f 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -596,8 +596,7 @@ Item *ItemContainer::getSelectedItem() const
{
if (mInventory != nullptr)
return mInventory->getItem(mSelectedIndex);
- else
- return nullptr;
+ return nullptr;
}
void ItemContainer::distributeValueChangedEvent()
diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp
index e4b40f9be..ee19caed1 100644
--- a/src/gui/widgets/setupitem.cpp
+++ b/src/gui/widgets/setupitem.cpp
@@ -104,8 +104,7 @@ Configuration *SetupItem::getConfig() const
{
if (mMainConfig == MainConfig_true)
return &config;
- else
- return &serverConfig;
+ return &serverConfig;
}
void SetupItem::load()
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index ced56cea0..e89f60418 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -223,8 +223,7 @@ Widget *TabbedArea::getCurrentWidget() const
if (tab != nullptr)
return getWidget(tab->getCaption());
- else
- return nullptr;
+ return nullptr;
}
void TabbedArea::addTab(Tab *const tab,
@@ -779,9 +778,8 @@ void TabbedArea::keyPressed(KeyEvent& event)
if (index < 0)
return;
- else
- setSelectedTab(mTabs[index].first);
+ setSelectedTab(mTabs[index].first);
event.consume();
}
else if (actionId == InputAction::GUI_RIGHT)
@@ -791,9 +789,8 @@ void TabbedArea::keyPressed(KeyEvent& event)
if (index >= CAST_S32(mTabs.size()))
return;
- else
- setSelectedTab(mTabs[index].first);
+ setSelectedTab(mTabs[index].first);
event.consume();
}
}
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp
index 31e000082..5d1696835 100644
--- a/src/gui/widgets/textbox.cpp
+++ b/src/gui/widgets/textbox.cpp
@@ -529,10 +529,8 @@ void TextBox::setCaretPosition(unsigned int position)
mCaretColumn = position;
return; // we are done
}
- else
- {
- position--;
- }
+
+ position--;
}
// position beyond end of text
diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h
index ed9110ba4..12103e317 100644
--- a/src/gui/widgets/widget2.h
+++ b/src/gui/widgets/widget2.h
@@ -57,8 +57,7 @@ class Widget2 notfinal
const ThemeColorIdT colorId = theme->getIdByChar(c, valid);
if (valid)
return theme->getColor(colorId + mPaletteOffset, 255U);
- else
- return Palette::BLACK;
+ return Palette::BLACK;
}
virtual void setWidget2(const Widget2 *const widget)