From: Carlos Lopez Date: Mon, 13 Dec 2010 20:11:57 +0000 (+0100) Subject: Make link_name(), link_local_name, and get_link_index_from_name non pure virtual... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=c318e91118d00d944b39c88eb6a34f6c6a89489e;p=synfig.git Make link_name(), link_local_name, and get_link_index_from_name non pure virtual functions --- 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(), jget_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(), jget_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;