Use translated versions of the type names everywhere other than in the .sif(z) files.
[synfig.git] / synfig-core / trunk / src / synfig / valuenode_linear.cpp
index b017c9a..d487b7b 100644 (file)
@@ -1,6 +1,6 @@
 /* === S Y N F I G ========================================================= */
 /*!    \file valuenode_linear.cpp
-**     \brief Template File
+**     \brief Implementation of the "Linear" valuenode conversion.
 **
 **     $Id$
 **
@@ -82,7 +82,7 @@ ValueNode_Linear::ValueNode_Linear(const ValueBase &value):
                set_link("offset",ValueNode_Const::create(value.get(Vector())));
                break;
        default:
-               throw Exception::BadType(ValueBase::type_name(get_type()));
+               throw Exception::BadType(ValueBase::type_local_name(get_type()));
        }
 
        DCAST_HACK_ENABLE();
@@ -157,7 +157,8 @@ ValueNode_Linear::check_type(ValueBase::Type type)
 bool
 ValueNode_Linear::set_link_vfunc(int i,ValueNode::Handle x)
 {
-       assert(i==0 || i==1);
+       assert(i>=0 && i<link_count());
+
        if(i==0)
        {
                m_=x;
@@ -176,7 +177,8 @@ ValueNode_Linear::set_link_vfunc(int i,ValueNode::Handle x)
 ValueNode::LooseHandle
 ValueNode_Linear::get_link_vfunc(int i)const
 {
-       assert(i==0 || i==1);
+       assert(i>=0 && i<link_count());
+
        if(i==0) return m_;
        if(i==1) return b_;
        return 0;
@@ -191,7 +193,8 @@ ValueNode_Linear::link_count()const
 String
 ValueNode_Linear::link_name(int i)const
 {
-       assert(i==0 || i==1);
+       assert(i>=0 && i<link_count());
+
        if(i==0) return "slope";
        if(i==1) return "offset";
        return String();
@@ -200,7 +203,8 @@ ValueNode_Linear::link_name(int i)const
 String
 ValueNode_Linear::link_local_name(int i)const
 {
-       assert(i==0 || i==1);
+       assert(i>=0 && i<link_count());
+
        if(i==0)
                switch(get_type())
                {