List the removed layers in the history dialog when removing layers.
[synfig.git] / synfig-core / trunk / src / synfig / valuenode_cos.cpp
index 50543b2..13f583d 100644 (file)
@@ -1,6 +1,6 @@
 /* === S Y N F I G ========================================================= */
 /*!    \file valuenode_cos.cpp
-**     \brief Template File
+**     \brief Implementation of the "Cos" valuenode conversion.
 **
 **     $Id$
 **
@@ -56,11 +56,11 @@ ValueNode_Cos::ValueNode_Cos(const ValueBase &value):
        switch(value.get_type())
        {
        case ValueBase::TYPE_REAL:
-               set_link("angle",ValueNode_Const::create(Angle::deg(90)));
+               set_link("angle",ValueNode_Const::create(Angle::deg(0)));
                set_link("amp",ValueNode_Const::create(value.get(Real())));
                break;
        default:
-               throw Exception::BadType(ValueBase::type_name(value.get_type()));
+               throw Exception::BadType(ValueBase::type_local_name(value.get_type()));
        }
 
        DCAST_HACK_ENABLE();
@@ -115,7 +115,8 @@ ValueNode_Cos::check_type(ValueBase::Type type)
 bool
 ValueNode_Cos::set_link_vfunc(int i,ValueNode::Handle x)
 {
-       assert(i==0 || i==1);
+       assert(i>=0 && i<link_count());
+
        if(i==0)
        {
                angle_=x;
@@ -134,7 +135,8 @@ ValueNode_Cos::set_link_vfunc(int i,ValueNode::Handle x)
 ValueNode::LooseHandle
 ValueNode_Cos::get_link_vfunc(int i)const
 {
-       assert(i==0 || i==1);
+       assert(i>=0 && i<link_count());
+
        if(i==0)
                return angle_;
        if(i==1)
@@ -152,7 +154,8 @@ ValueNode_Cos::link_count()const
 String
 ValueNode_Cos::link_name(int i)const
 {
-       assert(i==0 || i==1);
+       assert(i>=0 && i<link_count());
+
        if(i==0)
                return "angle";
        if(i==1)
@@ -163,7 +166,8 @@ ValueNode_Cos::link_name(int i)const
 String
 ValueNode_Cos::link_local_name(int i)const
 {
-       assert(i==0 || i==1);
+       assert(i>=0 && i<link_count());
+
        if(i==0)
                return _("Angle");
        if(i==1)