aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects/class_vbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/objects/class_vbox.cpp')
-rw-r--r--src/modules/objects/class_vbox.cpp33
1 files changed, 2 insertions, 31 deletions
diff --git a/src/modules/objects/class_vbox.cpp b/src/modules/objects/class_vbox.cpp
index 458e9f691..50db8a8ad 100644
--- a/src/modules/objects/class_vbox.cpp
+++ b/src/modules/objects/class_vbox.cpp
@@ -141,22 +141,7 @@ KVSO_CLASS_FUNCTION(vbox,setStretchFactor)
KVSO_PARAMETERS_END(c)
pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject);
if(!widget())return true;
- if (!pObject)
- {
- c->warning(__tr2qs("Widget parameter is not an object"));
- return true;
- }
- if (!pObject->object())
- {
- c->warning(__tr2qs("Widget parameter is not a valid object"));
- return true;
- }
- if(!pObject->object()->isWidgetType())
- {
- c->warning(__tr2qs("Can't add a non-widget object"));
- return true;
- }
-
+ CHECK_HOBJECT_IS_WIDGET(pObject)
if(((KviKvsObject_widget *)pObject)->widget()->parentWidget() != widget())
{
c->warning(__tr2qs("The widget must be a child of this vbox"));
@@ -186,21 +171,7 @@ KVSO_CLASS_FUNCTION(vbox,setAlignment)
KVSO_PARAMETERS_END(c)
pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject);
if(!widget())return true;
- if (!pObject)
- {
- c->warning(__tr2qs("Widget parameter is not an object"));
- return true;
- }
- if (!pObject->object())
- {
- c->warning(__tr2qs("Widget parameter is not a valid object"));
- return true;
- }
- if(!pObject->object()->isWidgetType())
- {
- c->warning(__tr2qs("Can't add a non-widget object"));
- return true;
- }
+ CHECK_HOBJECT_IS_WIDGET(pObject)
if(((KviKvsObject_widget *)pObject)->widget()->parentWidget() != widget())
{
c->warning(__tr2qs("The widget must be a child of this hbox"));