Fixed a crash. Revision 354's addition of the 'mutable String hex_;' in class Color...
[synfig.git] / synfig-core / trunk / src / synfig / valuenode.cpp
index f1df7ca..34843d0 100644 (file)
@@ -1,20 +1,21 @@
 /* === S Y N F I G ========================================================= */
-/*!    \file value_node.cpp
+/*!    \file valuenode.cpp
 **     \brief Template File
 **
-**     $Id: valuenode.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+**     $Id$
 **
 **     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
 **
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
+**     This package is free software; you can redistribute it and/or
+**     modify it under the terms of the GNU General Public License as
+**     published by the Free Software Foundation; either version 2 of
+**     the License, or (at your option) any later version.
 **
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
+**     This package is distributed in the hope that it will be useful,
+**     but WITHOUT ANY WARRANTY; without even the implied warranty of
+**     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+**     General Public License for more details.
 **     \endlegal
 */
 /* ========================================================================= */
@@ -105,7 +106,7 @@ ValueNode::subsys_init()
        ADD_VALUENODE2(ValueNode_DynamicList,"dynamic_list");
        ADD_VALUENODE(ValueNode_GradientRotate,"gradient_rotate");
        ADD_VALUENODE(ValueNode_Sine,"sine");
-       
+
 #undef ADD_VALUENODE
        return true;
 }
@@ -121,8 +122,8 @@ ValueNode::subsys_stop()
 
                if(global_value_node_map.size()!=value_node_count)
                        synfig::error("value node count mismatch! map.size()!=value_node_count (%d!=%d)",global_value_node_map.size(),value_node_count);
-               
-               GlobalValueNodeMap::iterator iter;              
+
+               GlobalValueNodeMap::iterator iter;
                for(iter=global_value_node_map.begin();iter!=global_value_node_map.end();++iter)
                {
                        if(!iter->second->is_exported())
@@ -177,13 +178,13 @@ bool
 LinkableValueNode::set_link(int i,ValueNode::Handle x)
 {
        ValueNode::Handle previous(get_link(i));
-       
+
        if(set_link_vfunc(i,x))
        {
                if(previous)
                        remove_child(previous.get());
                add_child(x.get());
-               
+
                if(!x->is_exported() && get_parent_canvas())
                {
                        x->set_parent_canvas(get_parent_canvas());
@@ -214,7 +215,7 @@ LinkableValueNode::unlink_all()
 ValueNode::~ValueNode()
 {
        value_node_count--;
-       
+
        begin_delete();
 
        //DEBUGPOINT();
@@ -227,7 +228,7 @@ ValueNode::on_changed()
                get_parent_canvas()->signal_value_node_changed()(this);
        else if(get_root_canvas() && get_parent_canvas())
                get_root_canvas()->signal_value_node_changed()(this);
-       
+
        Node::on_changed();
 }
 
@@ -236,7 +237,7 @@ ValueNode::replace(etl::handle<ValueNode> x)
 {
        if(x.get()==this)
                return 0;
-       
+
        while(parent_set.size())
        {
                (*parent_set.begin())->add_child(x.get());
@@ -317,9 +318,9 @@ ValueNodeList::surefind(const String &id)
 {
        if(id.empty())
                throw Exception::IDNotFound("Empty ID");
-       
+
        ValueNode::Handle value_node;
-       
+
        try
        {
                value_node=find(id);
@@ -374,11 +375,11 @@ ValueNodeList::add(ValueNode::Handle value_node)
                return false;
        }
        catch(Exception::IDNotFound)
-       {       
+       {
                push_back(value_node);
                return true;
        }
-       
+
        return false;
 }
 
@@ -439,7 +440,7 @@ LinkableValueNode::clone(const GUID& deriv_guid)const
        int i;
        LinkableValueNode *ret=create_new();
        ret->set_guid(get_guid()^deriv_guid);
-       
+
        for(i=0;i<link_count();i++)
        {
                ValueNode::Handle link=get_link_vfunc(i);
@@ -462,10 +463,10 @@ ValueNode::get_relative_id(etl::loose_handle<const Canvas> x)const
 {
        assert(is_exported());
        assert(canvas_);
-       
+
        if(x.get()==canvas_.get())
                return get_id();
-       
+
        return canvas_->_get_relative_id(x)+':'+get_id();
 }
 
@@ -484,9 +485,9 @@ ValueNode::set_root_canvas(etl::loose_handle<Canvas> x)
 void LinkableValueNode::get_times_vfunc(Node::time_set &set) const
 {
        ValueNode::LooseHandle  h;
-       
+
        int size = link_count();
-               
+
        //just add it to the set...
        for(int i=0; i < size; ++i)
        {