Accept 1927294: Patch from Gerald Young to allow intuitive editing of the BLinePoint...
[synfig.git] / synfig-studio / trunk / src / synfigapp / actions / activepointsetsmart.cpp
index c751401..3713e04 100644 (file)
@@ -100,17 +100,16 @@ Action::ActivepointSetSmart::get_param_vocab()
 bool
 Action::ActivepointSetSmart::is_candidate(const ParamList &x)
 {
-       if(candidate_check(get_param_vocab(),x))
-       {
-               ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
-               if(!value_desc.parent_is_value_node() || !ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()))
-                       return false;
+       if (!candidate_check(get_param_vocab(),x))
+               return false;
 
-               // We need either a activepoint or a time.
-               if(x.count("activepoint") || x.count("time"))
-                       return true;
-       }
-       return false;
+       ValueDesc value_desc(x.find("value_desc")->second.get_value_desc());
+
+       return (value_desc.parent_is_value_node() &&
+                       // We need a dynamic list.
+                       ValueNode_DynamicList::Handle::cast_dynamic(value_desc.get_parent_value_node()) &&
+                       // We need either an activepoint or a time.
+                       (x.count("activepoint") || x.count("time")));
 }
 
 bool
@@ -295,7 +294,7 @@ Action::ActivepointSetSmart::prepare()
                if(value_node->list[index].find(activepoint)==value_node->list[index].timing_info.end())
                        throw int();
 
-               // Then, lets try to replace the old activepoint, if it exists
+               // Then, let's try to replace the old activepoint, if it exists
                enclose_activepoint(*value_node->list[index].find(activepoint));
 
                Action::Handle action(ActivepointSet::create());