From 9bafc699bc426804d2bd73fcf9370dd9e1c522e5 Mon Sep 17 00:00:00 2001 From: dooglus Date: Thu, 27 Nov 2008 16:35:24 +0000 Subject: [PATCH] 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 --- synfig-core/trunk/src/synfig/layer.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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; -- 2.7.4