Module: synfig/synfig
Branch: genete_paramdesc
Commit: 2970d21d982d2f67b7da98d8e79a38da8746a732
URL:    
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig/synfig;a=commit;h=2970d21d982d2f67b7da98d8e79a38da8746a732

Author: Carlos Lopez <genet...@gmail.com>
Date:   Mon Dec 13 21:11:57 2010 +0100

Make link_name(), link_local_name, and get_link_index_from_name non pure 
virtual functions

---

 synfig-core/src/synfig/valuenode.cpp |   30 ++++++++++++++++++++++++++++++
 synfig-core/src/synfig/valuenode.h   |    6 +++---
 2 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/synfig-core/src/synfig/valuenode.cpp 
b/synfig-core/src/synfig/valuenode.cpp
index b423afc..a47394e 100644
--- a/synfig-core/src/synfig/valuenode.cpp
+++ b/synfig-core/src/synfig/valuenode.cpp
@@ -669,3 +669,33 @@ LinkableValueNode::get_description(int index, bool 
show_exported_name)const
        return description;
 }
 
+String
+LinkableValueNode::link_name(int i)const
+{
+       Vocab vocab(get_param_vocab());
+       Vocab::iterator iter(vocab.begin());
+       int j=0;
+       for(; iter!=vocab.end(), j<i; iter++, j++);
+       return iter!=vocab.end()?iter->get_name():String();
+}
+
+String
+LinkableValueNode::link_local_name(int i)const
+{
+       Vocab vocab(get_param_vocab());
+       Vocab::iterator iter(vocab.begin());
+       int j=0;
+       for(; iter!=vocab.end(), j<i; iter++, j++);
+       return iter!=vocab.end()?iter->get_local_name():String();
+}
+
+int
+LinkableValueNode::get_link_index_from_name(const String &name)const
+{
+       Vocab vocab(get_param_vocab());
+       Vocab::iterator iter(vocab.begin());
+       int j=0;
+       for(; iter!=vocab.end(); iter++, j++)
+               if(iter->get_name()==name) return j;
+       throw Exception::BadLinkName(name);
+}
diff --git a/synfig-core/src/synfig/valuenode.h 
b/synfig-core/src/synfig/valuenode.h
index 61b5d6a..8a1552e 100644
--- a/synfig-core/src/synfig/valuenode.h
+++ b/synfig-core/src/synfig/valuenode.h
@@ -373,13 +373,13 @@ public:
        virtual int link_count()const=0;
 
        //! Returns the local name of the 'i' linked Value Node
-       virtual String link_local_name(int i)const=0;
+       virtual String link_local_name(int i)const;
 
        //! Returns the name of the 'i' linked Value Node
-       virtual String link_name(int i)const=0;
+       virtual String link_name(int i)const;
 
        //! Returns the child index Value Node based on the name
-       virtual int get_link_index_from_name(const String &name)const=0;
+       virtual int get_link_index_from_name(const String &name)const;
 
        //! Clones a Value Node
        virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to