aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects/class_hbox.cpp
diff options
context:
space:
mode:
authorGravatar Noldor2008-10-16 12:28:36 +0000
committerGravatar Noldor2008-10-16 12:28:36 +0000
commit9e0effdc52a48f6ffe9ee04451b762c639fff688 (patch)
tree164e8410bc97a71420dcfef8a9b018e8adb7ee2f /src/modules/objects/class_hbox.cpp
parentsome fixes on the notifier (diff)
downloadKVIrc-9e0effdc52a48f6ffe9ee04451b762c639fff688.tar.gz
KVIrc-9e0effdc52a48f6ffe9ee04451b762c639fff688.tar.bz2
KVIrc-9e0effdc52a48f6ffe9ee04451b762c639fff688.zip
more works on objects module (locale stuff+some fixes+code clean)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2742 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/objects/class_hbox.cpp')
-rw-r--r--src/modules/objects/class_hbox.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/modules/objects/class_hbox.cpp b/src/modules/objects/class_hbox.cpp
index 340cfa8f7..3dcf15f7c 100644
--- a/src/modules/objects/class_hbox.cpp
+++ b/src/modules/objects/class_hbox.cpp
@@ -109,26 +109,29 @@ bool KviKvsObject_hbox::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *
KVSO_CLASS_FUNCTION(hbox,setMargin)
{
+ CHECK_INTERNAL_POINTER(widget())
kvs_uint_t uMargin;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("margin",KVS_PT_UNSIGNEDINTEGER,0,uMargin)
KVSO_PARAMETERS_END(c)
- if (widget()) ((KviTalHBox *)widget())->setMargin(uMargin);
+ ((KviTalHBox *)widget())->setMargin(uMargin);
return true;
}
KVSO_CLASS_FUNCTION(hbox,setSpacing)
{
+ CHECK_INTERNAL_POINTER(widget())
kvs_uint_t uSpacing;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("spacing",KVS_PT_UNSIGNEDINTEGER,0,uSpacing)
KVSO_PARAMETERS_END(c)
- if (widget()) ((KviTalHBox *)widget())->setSpacing(uSpacing);
+ ((KviTalHBox *)widget())->setSpacing(uSpacing);
return true;
}
KVSO_CLASS_FUNCTION(hbox,setStretchFactor)
{
+ CHECK_INTERNAL_POINTER(widget())
KviKvsObject * pObject;
kvs_hobject_t hObject;
kvs_uint_t uStretch;
@@ -137,7 +140,6 @@ KVSO_CLASS_FUNCTION(hbox,setStretchFactor)
KVSO_PARAMETER("stretch",KVS_PT_UNSIGNEDINTEGER,0,uStretch)
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"));
@@ -163,15 +165,17 @@ KVSO_CLASS_FUNCTION(hbox,setStretchFactor)
}
KVSO_CLASS_FUNCTION(hbox,addStretch)
{
+ CHECK_INTERNAL_POINTER(widget())
kvs_int_t iStretch;
KVSO_PARAMETERS_BEGIN(c)
KVSO_PARAMETER("stretch",KVS_PT_INT,0,iStretch)
KVSO_PARAMETERS_END(c)
- if (widget()) ((KviTalHBox *)widget())->addStretch(iStretch);
+ ((KviTalHBox *)widget())->addStretch(iStretch);
return true;
}
KVSO_CLASS_FUNCTION(hbox,setAlignment)
{
+ CHECK_INTERNAL_POINTER(widget())
QStringList alignment;
KviKvsObject * pObject;
kvs_hobject_t hObject;
@@ -180,7 +184,6 @@ KVSO_CLASS_FUNCTION(hbox,setAlignment)
KVSO_PARAMETER("alignment",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,alignment)
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"));