From 36ba43d6ea38062b17f7e63ef659962bfc51c64d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 6 Jun 2017 23:34:34 +0300 Subject: Fix clang-tidy check readability-implicit-bool-cast. --- src/gui/widgets/label.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/gui/widgets/label.cpp') 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; -- cgit v1.2.3-70-g09d2