summaryrefslogtreecommitdiff
path: root/src/gui/skin.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/skin.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/skin.cpp')
-rw-r--r--src/gui/skin.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/gui/skin.cpp b/src/gui/skin.cpp
index d3c2a048e..45317fa0d 100644
--- a/src/gui/skin.cpp
+++ b/src/gui/skin.cpp
@@ -45,18 +45,18 @@ Skin::Skin(ImageRect *const restrict skin,
mFilePath(filePath),
mName(name),
mBorder(skin),
- mCloseImage(images ? images->grid[0] : nullptr),
- mCloseImageHighlighted(images ? images->grid[1] : nullptr),
- mStickyImageUp(images ? images->grid[2] : nullptr),
- mStickyImageDown(images ? images->grid[3] : nullptr),
+ mCloseImage(images != nullptr ? images->grid[0] : nullptr),
+ mCloseImageHighlighted(images != nullptr ? images->grid[1] : nullptr),
+ mStickyImageUp(images != nullptr ? images->grid[2] : nullptr),
+ mStickyImageDown(images != nullptr ? images->grid[3] : nullptr),
mPadding(padding),
mTitlePadding(titlePadding),
mOptions(options)
{
- if (!mCloseImageHighlighted)
+ if (mCloseImageHighlighted == nullptr)
{
mCloseImageHighlighted = mCloseImage;
- if (mCloseImageHighlighted)
+ if (mCloseImageHighlighted != nullptr)
mCloseImageHighlighted->incRef();
}
}
@@ -65,32 +65,32 @@ Skin::~Skin()
{
for (int i = 0; i < 9; i++)
{
- if (mBorder && mBorder->grid[i])
+ if ((mBorder != nullptr) && (mBorder->grid[i] != nullptr))
{
mBorder->grid[i]->decRef();
mBorder->grid[i] = nullptr;
}
}
- if (mCloseImage)
+ if (mCloseImage != nullptr)
{
mCloseImage->decRef();
mCloseImage = nullptr;
}
- if (mCloseImageHighlighted)
+ if (mCloseImageHighlighted != nullptr)
{
mCloseImageHighlighted->decRef();
mCloseImageHighlighted = nullptr;
}
- if (mStickyImageUp)
+ if (mStickyImageUp != nullptr)
{
mStickyImageUp->decRef();
mStickyImageUp = nullptr;
}
- if (mStickyImageDown)
+ if (mStickyImageDown != nullptr)
{
mStickyImageDown->decRef();
mStickyImageDown = nullptr;
@@ -106,30 +106,30 @@ void Skin::updateAlpha(const float minimumOpacityAllowed)
std::max(static_cast<double>(minimumOpacityAllowed),
static_cast<double>(settings.guiAlpha)));
- if (mBorder)
+ if (mBorder != nullptr)
{
for (int i = 0; i < 9; i++)
{
- if (mBorder->grid[i])
+ if (mBorder->grid[i] != nullptr)
mBorder->grid[i]->setAlpha(alpha);
}
}
- if (mCloseImage)
+ if (mCloseImage != nullptr)
mCloseImage->setAlpha(alpha);
- if (mCloseImageHighlighted)
+ if (mCloseImageHighlighted != nullptr)
mCloseImageHighlighted->setAlpha(alpha);
- if (mStickyImageUp)
+ if (mStickyImageUp != nullptr)
mStickyImageUp->setAlpha(alpha);
- if (mStickyImageDown)
+ if (mStickyImageDown != nullptr)
mStickyImageDown->setAlpha(alpha);
}
int Skin::getMinWidth() const
{
- if (!mBorder ||
- !mBorder->grid[ImagePosition::UPPER_LEFT] ||
- !mBorder->grid[ImagePosition::UPPER_RIGHT])
+ if ((mBorder == nullptr) ||
+ (mBorder->grid[ImagePosition::UPPER_LEFT] == nullptr) ||
+ (mBorder->grid[ImagePosition::UPPER_RIGHT] == nullptr))
{
return 1;
}
@@ -140,9 +140,9 @@ int Skin::getMinWidth() const
int Skin::getMinHeight() const
{
- if (!mBorder ||
- !mBorder->grid[ImagePosition::UPPER_LEFT] ||
- !mBorder->grid[ImagePosition::LOWER_LEFT])
+ if ((mBorder == nullptr) ||
+ (mBorder->grid[ImagePosition::UPPER_LEFT] == nullptr) ||
+ (mBorder->grid[ImagePosition::LOWER_LEFT] == nullptr))
{
return 1;
}