Break the ValueNode 'bad type' error messages up so less translation needs doing.
[synfig.git] / synfig-core / trunk / src / synfig / valuenode_gradientrotate.cpp
index 9449d71..8de8007 100644 (file)
@@ -1,6 +1,6 @@
 /* === S Y N F I G ========================================================= */
 /*!    \file valuenode_gradientrotate.cpp
-**     \brief Template File
+**     \brief Implementation of the "Gradient Rotate" valuenode conversion.
 **
 **     $Id$
 **
@@ -73,7 +73,7 @@ ValueNode_GradientRotate::create(const ValueBase& x)
        if(id!=ValueBase::TYPE_GRADIENT)
        {
                assert(0);
-               throw runtime_error("synfig::ValueNode_GradientRotate:Bad type "+ValueBase::type_name(id));
+               throw runtime_error(String(_("Gradient Rotate"))+_(":Bad type ")+ValueBase::type_local_name(id));
        }
 
        ValueNode_GradientRotate* value_node=new ValueNode_GradientRotate(x.get(Gradient()));
@@ -124,7 +124,8 @@ synfig::ValueNode_GradientRotate::operator()(Time t)const
 bool
 ValueNode_GradientRotate::set_link_vfunc(int i,ValueNode::Handle x)
 {
-       assert(i>=0 && i<3);
+       assert(i>=0 && i<link_count());
+
        switch(i)
        {
                case 0:
@@ -141,7 +142,8 @@ ValueNode_GradientRotate::set_link_vfunc(int i,ValueNode::Handle x)
 ValueNode::LooseHandle
 ValueNode_GradientRotate::get_link_vfunc(int i)const
 {
-       assert(i>=0 && i<3);
+       assert(i>=0 && i<link_count());
+
        switch(i)
        {
                case 0:
@@ -161,7 +163,8 @@ ValueNode_GradientRotate::link_count()const
 String
 ValueNode_GradientRotate::link_local_name(int i)const
 {
-       assert(i>=0 && i<2);
+       assert(i>=0 && i<link_count());
+
        switch(i)
        {
                case 0:
@@ -176,7 +179,8 @@ ValueNode_GradientRotate::link_local_name(int i)const
 String
 ValueNode_GradientRotate::link_name(int i)const
 {
-       assert(i>=0 && i<2);
+       assert(i>=0 && i<link_count());
+
        switch(i)
        {
                case 0: