Add type checking for the Random ValueNode too.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 11 Jan 2008 09:46:03 +0000 (09:46 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 11 Jan 2008 09:46:03 +0000 (09:46 +0000)
git-svn-id: http://svn.voria.com/code@1327 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/modules/mod_noise/valuenode_random.cpp

index 101f793..273416b 100644 (file)
@@ -173,32 +173,17 @@ ValueNode_Random::get_local_name()const
 }
 
 bool
-ValueNode_Random::set_link_vfunc(int i,ValueNode::Handle x)
+ValueNode_Random::set_link_vfunc(int i,ValueNode::Handle value)
 {
        assert(i>=0 && i<link_count());
 
        switch(i)
        {
-       case 0:
-               link_=x;
-               signal_child_changed()(i);signal_value_changed()();
-               return true;
-       case 1:
-               radius_=x;
-               signal_child_changed()(i);signal_value_changed()();
-               return true;
-       case 2:
-               seed_=x;
-               signal_child_changed()(i);signal_value_changed()();
-               return true;
-       case 3:
-               speed_=x;
-               signal_child_changed()(i);signal_value_changed()();
-               return true;
-       case 4:
-               smooth_=x;
-               signal_child_changed()(i);signal_value_changed()();
-               return true;
+       case 0: CHECK_TYPE_AND_SET_VALUE(link_,   get_type());
+       case 1: CHECK_TYPE_AND_SET_VALUE(radius_, ValueBase::TYPE_REAL);
+       case 2: CHECK_TYPE_AND_SET_VALUE(seed_,   ValueBase::TYPE_INTEGER);
+       case 3: CHECK_TYPE_AND_SET_VALUE(speed_,  ValueBase::TYPE_REAL);
+       case 4: CHECK_TYPE_AND_SET_VALUE(smooth_, ValueBase::TYPE_INTEGER);
        }
        return false;
 }