diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-03-02 21:17:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-03-02 21:17:13 +0300 |
commit | 181ecd0c3bf27b47487f973fb83b988fd6ceaecf (patch) | |
tree | 4ee3de6acd80bf81d0960ac49d64f718f5019102 /src/gui/widgets | |
parent | fb1709d774139b2173da6ee95770abaad23f726e (diff) | |
download | ManaVerse-181ecd0c3bf27b47487f973fb83b988fd6ceaecf.tar.gz ManaVerse-181ecd0c3bf27b47487f973fb83b988fd6ceaecf.tar.bz2 ManaVerse-181ecd0c3bf27b47487f973fb83b988fd6ceaecf.tar.xz ManaVerse-181ecd0c3bf27b47487f973fb83b988fd6ceaecf.zip |
Another fixes after Coverity checks.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 3 | ||||
-rw-r--r-- | src/gui/widgets/dropdown.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/progressindicator.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/scrollarea.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/window.cpp | 5 |
5 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index b69664ddd..f2907aaf3 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -293,7 +293,8 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics) } } - setWidth(parent->getWidth() - 10); + if (parent) + setWidth(parent->getWidth() - 10); BLOCK_END("AvatarListBox::draw") } diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index d4fde01dc..5cffb8d72 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -152,8 +152,7 @@ DropDown::DropDown(const Widget2 *const widget, if (listener) addActionListener(listener); - if (mPopup) - mPopup->adjustSize(); + mPopup->adjustSize(); if (mSkin) { @@ -446,9 +445,6 @@ void DropDown::adjustHeight() void DropDown::dropDown() { - if (!mPopup) - return; - if (!mDroppedDown) { mDroppedDown = true; diff --git a/src/gui/widgets/progressindicator.cpp b/src/gui/widgets/progressindicator.cpp index 401b45754..c0667f720 100644 --- a/src/gui/widgets/progressindicator.cpp +++ b/src/gui/widgets/progressindicator.cpp @@ -37,14 +37,12 @@ ProgressIndicator::ProgressIndicator() : ImageSet *const images = Theme::getImageSetFromTheme( "progress-indicator.png", 32, 32); - Animation *const anim = new Animation; if (images) { + Animation *const anim = new Animation; for (ImageSet::size_type i = 0, sz = images->size(); i < sz; ++i) anim->addFrame(images->get(i), 100, 0, 0, 100); - mIndicator = new SimpleAnimation(anim); - images->decRef(); } diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 838e5dad2..6d15c5520 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -412,7 +412,7 @@ void ScrollArea::drawButton(gcn::Graphics *const graphics, default: logger->log("ScrollArea::drawButton unknown dir: " + toString(static_cast<unsigned>(dir))); - break; + return; } if (buttons[dir][state]) @@ -450,7 +450,7 @@ void ScrollArea::calcButton(gcn::Graphics *const graphics, default: logger->log("ScrollArea::drawButton unknown dir: " + toString(static_cast<unsigned>(dir))); - break; + return; } if (buttons[dir][state]) diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index bb9e12320..54ed4764f 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -86,6 +86,11 @@ Window::Window(const std::string &caption, const bool modal, { logger->log("Window::Window(\"%s\")", caption.c_str()); +#ifndef USE_INTERNALGUICHAN + mDragOffsetX = 0; + mDragOffsetY = 0; +#endif + if (!windowContainer) throw GCN_EXCEPTION("Window::Window(): no windowContainer set"); |