diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-07-04 17:49:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-07-04 17:49:59 +0300 |
commit | a2bfd50be766b3303f3e8dead3b42d16c60f6081 (patch) | |
tree | 9b1e8ab888c2c45350369c132df180a1fb63c975 /src/guichan/widget.cpp | |
parent | 4b2cb3433c82ba4ba28be8de82e0a49df7f3e388 (diff) | |
download | plus-a2bfd50be766b3303f3e8dead3b42d16c60f6081.tar.gz plus-a2bfd50be766b3303f3e8dead3b42d16c60f6081.tar.bz2 plus-a2bfd50be766b3303f3e8dead3b42d16c60f6081.tar.xz plus-a2bfd50be766b3303f3e8dead3b42d16c60f6081.zip |
Fix code style and compilation warnings.
Diffstat (limited to 'src/guichan/widget.cpp')
-rw-r--r-- | src/guichan/widget.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/guichan/widget.cpp b/src/guichan/widget.cpp index 8ec3a8178..6c02384b9 100644 --- a/src/guichan/widget.cpp +++ b/src/guichan/widget.cpp @@ -309,10 +309,10 @@ namespace gcn bool Widget::isVisible() const { - if (getParent() == NULL) + if (!mParent) return mVisible; else - return mVisible && getParent()->isVisible(); + return mVisible && mParent->isVisible(); } void Widget::setBaseColor(const Color& color) @@ -436,7 +436,7 @@ namespace gcn void Widget::getAbsolutePosition(int& x, int& y) const { - if (getParent() == NULL) + if (!mParent) { x = mDimension.x; y = mDimension.y; @@ -446,10 +446,11 @@ namespace gcn int parentX; int parentY; - getParent()->getAbsolutePosition(parentX, parentY); + mParent->getAbsolutePosition(parentX, parentY); - x = parentX + mDimension.x + getParent()->getChildrenArea().x; - y = parentY + mDimension.y + getParent()->getChildrenArea().y; + const Rectangle &rect = mParent->getChildrenArea(); + x = parentX + mDimension.x + rect.x; + y = parentY + mDimension.y + rect.y; } Font* Widget::getFont() const @@ -574,10 +575,10 @@ namespace gcn "the widget to the gui?)."); } - if (getParent() != NULL) + if (mParent) { return (mFocusHandler->getModalFocused() == this) - || getParent()->isModalFocused(); + || mParent->isModalFocused(); } return mFocusHandler->getModalFocused() == this; @@ -591,10 +592,10 @@ namespace gcn "the widget to the gui?)."); } - if (getParent() != NULL) + if (mParent) { return (mFocusHandler->getModalMouseInputFocused() == this) - || getParent()->isModalMouseInputFocused(); + || mParent->isModalMouseInputFocused(); } return mFocusHandler->getModalMouseInputFocused() == this; |