String
ValueNode::get_description(bool show_exported_name)const
{
+ String ret(_("ValueNode"));
+
if (dynamic_cast<const LinkableValueNode*>(this))
return (dynamic_cast<const LinkableValueNode*>(this))->get_description(-1, show_exported_name);
- return "ValueNode";
+ if (show_exported_name && !is_exported())
+ show_exported_name = false;
+
+ if (show_exported_name)
+ ret += strprintf(" (%s)", get_id().c_str());
+
+ return ret;
}
ValueNodeList::ValueNodeList():
if(id.empty())
return false;
- for(iter=begin();iter!=end() && id!=(*iter)->get_id();++iter);
+ for(iter=begin();iter!=end() && id!=(*iter)->get_id();++iter)
+ ;
if(iter==end())
return false;
if(id.empty())
throw Exception::IDNotFound("Empty ID");
- for(iter=begin();iter!=end() && id!=(*iter)->get_id();++iter);
+ for(iter=begin();iter!=end() && id!=(*iter)->get_id();++iter)
+ ;
if(iter==end())
throw Exception::IDNotFound("ValueNode in ValueNodeList: "+id);
if(id.empty())
throw Exception::IDNotFound("Empty ID");
- for(iter=begin();iter!=end() && id!=(*iter)->get_id();++iter);
+ for(iter=begin();iter!=end() && id!=(*iter)->get_id();++iter)
+ ;
if(iter==end())
throw Exception::IDNotFound("ValueNode in ValueNodeList: "+id);
{
String description;
- if (show_exported_name && !is_exported())
- show_exported_name = false;
-
- if (index != -1)
+ if (index == -1)
+ {
+ if (show_exported_name && is_exported())
+ description += strprintf(" (%s)", get_id().c_str());
+ }
+ else
+ {
description = String(":") + link_local_name(index);
+ if (show_exported_name)
+ {
+ ValueNode::LooseHandle link(get_link(index));
+ if (link->is_exported())
+ description += strprintf(" (%s)", link->get_id().c_str());
+ }
+ }
+
const synfig::Node* node = this;
LinkableValueNode::ConstHandle parent_linkable_vn = 0;
description.c_str());
}
- if (show_exported_name)
- description += strprintf(" (%s)", get_id().c_str());
-
return description;
}