summaryrefslogtreecommitdiff
path: root/src/gui/widgets/label.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/label.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/label.cpp')
-rw-r--r--src/gui/widgets/label.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp
index 52fdbd716..aeacddbdb 100644
--- a/src/gui/widgets/label.cpp
+++ b/src/gui/widgets/label.cpp
@@ -106,16 +106,16 @@ Label::Label(const Widget2 *const widget,
Label::~Label()
{
- if (mWindow)
+ if (mWindow != nullptr)
mWindow->removeWidgetListener(this);
- if (gui)
+ if (gui != nullptr)
gui->removeDragged(this);
mInstances --;
if (mInstances == 0)
{
- if (theme)
+ if (theme != nullptr)
theme->unload(mSkin);
}
removeMouseListener(this);
@@ -130,12 +130,12 @@ void Label::init()
mForegroundColor2 = getThemeColor(ThemeColorId::LABEL_OUTLINE);
if (mInstances == 0)
{
- if (theme)
+ if (theme != nullptr)
mSkin = theme->load("label.xml", "");
}
mInstances ++;
- if (mSkin)
+ if (mSkin != nullptr)
mPadding = mSkin->getPadding();
else
mPadding = 0;
@@ -179,7 +179,7 @@ void Label::draw(Graphics *const graphics)
}
const Image *const image = mTextChunk.img;
- if (image)
+ if (image != nullptr)
graphics->drawImage(image, textX, textY);
BLOCK_END("Label::draw")
}
@@ -262,14 +262,14 @@ void Label::setCaption(const std::string& caption)
void Label::setParent(Widget *const widget)
{
- if (mWindow)
+ if (mWindow != nullptr)
mWindow->addWidgetListener(this);
Widget::setParent(widget);
}
void Label::setWindow(Widget *const widget)
{
- if (!widget && mWindow)
+ if ((widget == nullptr) && (mWindow != nullptr))
{
mWindow->removeWidgetListener(this);
mWindow = nullptr;