summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-02 01:23:15 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-02 01:23:15 +0300
commitb96e34946aa326a9f8dfb80ce34cce9fc219405e (patch)
tree964b4d36e8a018c0c656b9d52a291202c7dc6704 /src/gui/widgets
parent91737976634821cef7d1e373ac8bf7a7b2e95a69 (diff)
downloadmanaverse-b96e34946aa326a9f8dfb80ce34cce9fc219405e.tar.gz
manaverse-b96e34946aa326a9f8dfb80ce34cce9fc219405e.tar.bz2
manaverse-b96e34946aa326a9f8dfb80ce34cce9fc219405e.tar.xz
manaverse-b96e34946aa326a9f8dfb80ce34cce9fc219405e.zip
Add missing checks.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/popup.cpp21
-rw-r--r--src/gui/widgets/scrollarea.cpp3
-rw-r--r--src/gui/widgets/tab.cpp3
-rw-r--r--src/gui/widgets/window.cpp21
4 files changed, 41 insertions, 7 deletions
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp
index 7519d1583..bc15a4c2c 100644
--- a/src/gui/widgets/popup.cpp
+++ b/src/gui/widgets/popup.cpp
@@ -142,13 +142,28 @@ void Popup::setLocationRelativeTo(gcn::Widget *widget)
void Popup::setMinWidth(int width)
{
- mMinWidth = width > mSkin->getMinWidth() ? width : mSkin->getMinWidth();
+ if (mSkin)
+ {
+ mMinWidth = width > mSkin->getMinWidth()
+ ? width : mSkin->getMinWidth();
+ }
+ else
+ {
+ mMinWidth = width;
+ }
}
void Popup::setMinHeight(int height)
{
- mMinHeight = height > mSkin->getMinHeight() ?
- height : mSkin->getMinHeight();
+ if (mSkin)
+ {
+ mMinHeight = height > mSkin->getMinHeight() ?
+ height : mSkin->getMinHeight();
+ }
+ else
+ {
+ mMinHeight = height;
+ }
}
void Popup::setMaxWidth(int width)
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp
index a78048314..0be492ee6 100644
--- a/src/gui/widgets/scrollarea.cpp
+++ b/src/gui/widgets/scrollarea.cpp
@@ -148,7 +148,8 @@ void ScrollArea::init()
}
}
- textbox->decRef();
+ if (textbox)
+ textbox->decRef();
// Load vertical scrollbar skin
Image *vscroll = Theme::getImageFromTheme("vscroll_grey.png");
diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp
index 6750ffbbc..73ffff30e 100644
--- a/src/gui/widgets/tab.cpp
+++ b/src/gui/widgets/tab.cpp
@@ -108,6 +108,9 @@ void Tab::init()
for (mode = 0; mode < TAB_COUNT; mode++)
{
tab[mode] = Theme::getImageFromTheme(data[mode].file);
+ if (!tab[mode])
+ continue;
+
a = 0;
for (y = 0; y < 3; y++)
{
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 3531ac245..14f39a4c3 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -273,13 +273,28 @@ void Window::setLocationRelativeTo(ImageRect::ImagePosition position,
void Window::setMinWidth(int width)
{
- mMinWinWidth = width > mSkin->getMinWidth() ? width : mSkin->getMinWidth();
+ if (mSkin)
+ {
+ mMinWinWidth = width > mSkin->getMinWidth()
+ ? width : mSkin->getMinWidth();
+ }
+ else
+ {
+ mMinWinWidth = width;
+ }
}
void Window::setMinHeight(int height)
{
- mMinWinHeight = height > mSkin->getMinHeight() ?
- height : mSkin->getMinHeight();
+ if (mSkin)
+ {
+ mMinWinHeight = height > mSkin->getMinHeight() ?
+ height : mSkin->getMinHeight();
+ }
+ else
+ {
+ mMinWinHeight = height;
+ }
}
void Window::setMaxWidth(int width)