From: dooglus Date: Thu, 27 Nov 2008 16:35:24 +0000 (+0000) Subject: Fix 2353284: If two parameters in the same layer are connected to the same valuenode... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=9bafc699bc426804d2bd73fcf9370dd9e1c522e5;p=synfig.git Fix 2353284: If two parameters in the same layer are connected to the same valuenode and we disconnect one of them, the parent-child relationship for the remaining connection was being deleted. Now we search the parameter list to see if another parameter uses the same valuenode. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2291 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/layer.cpp b/synfig-core/trunk/src/synfig/layer.cpp index 7643883..8fcbfbf 100644 --- a/synfig-core/trunk/src/synfig/layer.cpp +++ b/synfig-core/trunk/src/synfig/layer.cpp @@ -266,7 +266,19 @@ Layer::disconnect_dynamic_param(const String& param) if(previous) { dynamic_param_list_.erase(param); - remove_child(previous.get()); + + // fix 2353284: if two parameters in the same layer are + // connected to the same valuenode and we disconnect one of + // them, the parent-child relationship for the remaining + // connection was being deleted. now we search the parameter + // list to see if another parameter uses the same valuenode + DynamicParamList::const_iterator iter; + for (iter = dynamic_param_list().begin(); iter != dynamic_param_list().end(); iter++) + if (iter->second == previous) + break; + if (iter == dynamic_param_list().end()) + remove_child(previous.get()); + changed(); } return true;