/* === S Y N F I G ========================================================= */
/*! \file valuenode_dynamiclist.cpp
-** \brief Template File
+** \brief Implementation of the "Dynamic List" valuenode conversion.
**
-** $Id: valuenode_dynamiclist.cpp,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
+** $Id$
**
** \legal
** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
ActivepointList::const_iterator prev_iter;
bool state(true);
- // New "symetric" state mechanism
+ // New "symmetric" state mechanism
if(!timing_info.empty())
{
if(timing_info.size()==1)
if(value_node)
{
remove_child(value_node.get());
- if(get_parent_canvas())
- get_parent_canvas()->signal_value_node_child_removed()(this,value_node);
- else if(get_root_canvas() && get_parent_canvas())
+ // changed to fix bug 1420091 - it seems that when a .sif file containing a bline layer encapsulated inside
+ // another layer, get_parent_canvas() is false and get_root_canvas() is true, but when we come to erase a
+ // vertex, both are true. So the signal is sent to the parent, but the signal wasn't sent to the parent
+ // when it was added. This probably isn't the right fix, but it seems to work for now. Note that the same
+ // strange "if (X) else if (Y && X)" code is also present in the two previous functions, above.
+
+ // if(get_parent_canvas())
+ // get_parent_canvas()->signal_value_node_child_removed()(this,value_node);
+ // else if(get_root_canvas() && get_parent_canvas())
+ // get_root_canvas()->signal_value_node_child_removed()(this,value_node);
+ if(get_root_canvas())
get_root_canvas()->signal_value_node_child_removed()(this,value_node);
}
break;
ValueNode_DynamicList::set_link_vfunc(int i,ValueNode::Handle x)
{
assert(i>=0);
+
if((unsigned)i>=list.size())
return false;
if(x->get_type()!=container_type)
ValueNode_DynamicList::get_link_vfunc(int i)const
{
assert(i>=0);
+
if((unsigned)i>=list.size())
return 0;
return list[i].value_node;
String
ValueNode_DynamicList::link_local_name(int i)const
{
- assert(i>=0 && (unsigned)i<list.size());
+ assert(i>=0 && i<link_count());
+
return etl::strprintf(_("Item %03d"),i+1);
}
ValueNode_DynamicList::create_new()const
{
assert(0);
+
return 0;
}