summaryrefslogtreecommitdiff
path: root/src/gui/widgets/sliderlist.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-06 23:34:34 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-07 19:23:40 +0300
commit36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch)
tree190156cb88b13a38a6d13c69ee0742cc078065a1 /src/gui/widgets/sliderlist.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/gui/widgets/sliderlist.cpp')
-rw-r--r--src/gui/widgets/sliderlist.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/widgets/sliderlist.cpp b/src/gui/widgets/sliderlist.cpp
index 3b42b43e5..edce0cf02 100644
--- a/src/gui/widgets/sliderlist.cpp
+++ b/src/gui/widgets/sliderlist.cpp
@@ -68,7 +68,7 @@ void SliderList::postInit2(ActionListener *const listener,
if (!eventId.empty())
setActionEventId(eventId);
- if (listener)
+ if (listener != nullptr)
addActionListener(listener);
updateLabel();
@@ -135,7 +135,7 @@ void SliderList::safeDraw(Graphics *const graphics)
void SliderList::updateLabel()
{
- if (!mListModel || mSelectedIndex < 0
+ if ((mListModel == nullptr) || mSelectedIndex < 0
|| mSelectedIndex >= mListModel->getNumberOfElements())
{
return;
@@ -157,7 +157,7 @@ void SliderList::updateLabel()
void SliderList::action(const ActionEvent &event)
{
- if (!mListModel)
+ if (mListModel == nullptr)
return;
const std::string &eventId = event.getId();
@@ -179,7 +179,7 @@ void SliderList::action(const ActionEvent &event)
void SliderList::setSelectedString(const std::string &str)
{
- if (!mListModel)
+ if (mListModel == nullptr)
return;
for (int f = 0; f < mListModel->getNumberOfElements(); f ++)
@@ -194,7 +194,7 @@ void SliderList::setSelectedString(const std::string &str)
std::string SliderList::getSelectedString() const
{
- if (!mListModel)
+ if (mListModel == nullptr)
return std::string();
return mListModel->getElementAt(mSelectedIndex);
@@ -202,7 +202,7 @@ std::string SliderList::getSelectedString() const
void SliderList::setSelected(const int idx)
{
- if (!mListModel)
+ if (mListModel == nullptr)
return;
mSelectedIndex = idx;
@@ -222,7 +222,7 @@ void SliderList::adjustSize()
int SliderList::getMaxLabelWidth() const
{
- if (!mListModel || !gui)
+ if ((mListModel == nullptr) || (gui == nullptr))
return 1;
int maxWidth = 0;