Default the time sub-parameter to 0f. Check that the valuenode has a parent canvas...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 9 Apr 2008 12:17:20 +0000 (12:17 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 9 Apr 2008 12:17:20 +0000 (12:17 +0000)
git-svn-id: http://svn.voria.com/code@2001 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/valuenode_timestring.cpp

index 0198716..628b504 100644 (file)
@@ -57,7 +57,7 @@ ValueNode_TimeString::ValueNode_TimeString(const ValueBase &value):
        switch(value.get_type())
        {
        case ValueBase::TYPE_STRING:
-               set_link("time",ValueNode_Const::create(Time()));
+               set_link("time",ValueNode_Const::create(Time(0)));
                break;
        default:
                throw Exception::BadType(ValueBase::type_local_name(value.get_type()));
@@ -91,7 +91,10 @@ ValueNode_TimeString::operator()(Time t)const
        switch (get_type())
        {
        case ValueBase::TYPE_STRING:
-               return time.get_string(get_parent_canvas()->rend_desc().get_frame_rate());
+               if (get_parent_canvas())
+                       return time.get_string(get_parent_canvas()->rend_desc().get_frame_rate());
+               else
+                       return time.get_string();
        default:
                break;
        }