summaryrefslogtreecommitdiff
path: root/src/gui/widgets/shoplistbox.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/shoplistbox.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/shoplistbox.cpp')
-rw-r--r--src/gui/widgets/shoplistbox.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp
index f1e5ed32f..3df46b854 100644
--- a/src/gui/widgets/shoplistbox.cpp
+++ b/src/gui/widgets/shoplistbox.cpp
@@ -91,7 +91,7 @@ void ShopListBox::setPlayersMoney(const int money)
void ShopListBox::draw(Graphics *const graphics)
{
BLOCK_START("ShopListBox::draw")
- if (!mListModel || !mShopItems)
+ if ((mListModel == nullptr) || (mShopItems == nullptr))
{
BLOCK_END("ShopListBox::draw")
return;
@@ -116,7 +116,7 @@ void ShopListBox::draw(Graphics *const graphics)
Color* backgroundColor = &mBackgroundColor;
ShopItem *const item = mShopItems->at(i);
- if (item &&
+ if ((item != nullptr) &&
(item->getDisabled() ||
(mPlayerMoney < item->getPrice() && mPriceCheck) ||
(mProtectItems && PlayerInfo::isItemProtected(item->getId()))))
@@ -155,10 +155,10 @@ void ShopListBox::draw(Graphics *const graphics)
width, mRowHeight));
}
- if (mShopItems && item)
+ if ((mShopItems != nullptr) && (item != nullptr))
{
Image *const icon = item->getImage();
- if (icon)
+ if (icon != nullptr)
{
icon->setAlpha(1.0F);
graphics->drawImage(icon, mPadding, y + mPadding);
@@ -194,7 +194,7 @@ void ShopListBox::safeDraw(Graphics *const graphics)
void ShopListBox::adjustSize()
{
BLOCK_START("ShopListBox::adjustSize")
- if (mListModel)
+ if (mListModel != nullptr)
{
setHeight(mRowHeight * mListModel->getNumberOfElements()
+ 2 * mPadding);
@@ -209,10 +209,10 @@ void ShopListBox::setPriceCheck(const bool check)
void ShopListBox::mouseMoved(MouseEvent &event)
{
- if (!itemPopup || !mRowHeight)
+ if ((itemPopup == nullptr) || (mRowHeight == 0u))
return;
- if (!mShopItems)
+ if (mShopItems == nullptr)
{
itemPopup->hide();
return;
@@ -227,7 +227,7 @@ void ShopListBox::mouseMoved(MouseEvent &event)
else
{
const Item *const item = mShopItems->at(index);
- if (item)
+ if (item != nullptr)
{
itemPopup->setItem(item, false);
itemPopup->position(viewport->mMouseX, viewport->mMouseY);
@@ -265,7 +265,7 @@ void ShopListBox::mouseReleased(MouseEvent& event)
inventory = PlayerInfo::getCartInventory();
else
return;
- if (!inventory)
+ if (inventory == nullptr)
return;
Item *const item = inventory->getItem(dragDrop.getTag());
if (mType == ShopListBoxType::BuyShop)
@@ -292,7 +292,7 @@ void ShopListBox::mouseReleased(MouseEvent& event)
return;
Item *const item = mShopItems->at(mSelected);
- if (popupMenu && viewport)
+ if ((popupMenu != nullptr) && (viewport != nullptr))
{
popupMenu->showItemPopup(viewport->mMouseX,
viewport->mMouseY,
@@ -303,7 +303,7 @@ void ShopListBox::mouseReleased(MouseEvent& event)
void ShopListBox::mouseExited(MouseEvent& event A_UNUSED)
{
- if (!itemPopup)
+ if (itemPopup == nullptr)
return;
itemPopup->hide();