Added copyright lines for files I've edited this year.
[synfig.git] / synfig-core / trunk / src / synfig / valuenode_composite.cpp
index e10999a..61b6c64 100644 (file)
@@ -6,6 +6,7 @@
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**     Copyright (c) 2008 Chris Moore
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -37,6 +38,7 @@
 #include "vector.h"
 #include "color.h"
 #include "segment.h"
+#include "savecanvas.h"
 
 #endif
 
@@ -309,6 +311,9 @@ ValueNode_Composite::link_name(int i)const
 {
        assert(i>=0 && i<link_count());
 
+       if (get_file_version() < RELEASE_VERSION_0_61_08)
+               return strprintf("c%d",i+1);
+
        switch(get_type())
        {
        case ValueBase::TYPE_COLOR:
@@ -364,11 +369,8 @@ ValueNode_Composite::get_link_index_from_name(const String &name)const
        if(name.empty())
                throw Exception::BadLinkName(name);
 
-       if(name[0]=='c')
-       {
-               warning("%s:%d is this EVER called?", __FILE__, __LINE__);
+       if(name[0]=='c' && name.size() == 2 && name[1]-'1' >= 0 && name[1]-'1' < link_count())
                return name[1]-'1';
-       }
 
        switch(get_type())
        {