X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftags%2Fstable%2Fsrc%2Fsynfigapp%2Factions%2Factivepointsetsmart.cpp;h=51de04002c863a58ad387dcdf14faac456a2e240;hb=47fce282611fbba1044921d22ca887f9b53ad91a;hp=895f3092d565b9d52a17bb79faf4634ae520dbc9;hpb=f6184c2a9c2245aae802c31c8f3300e1b744359c;p=synfig.git diff --git a/synfig-studio/tags/stable/src/synfigapp/actions/activepointsetsmart.cpp b/synfig-studio/tags/stable/src/synfigapp/actions/activepointsetsmart.cpp index 895f309..51de040 100644 --- a/synfig-studio/tags/stable/src/synfigapp/actions/activepointsetsmart.cpp +++ b/synfig-studio/tags/stable/src/synfigapp/actions/activepointsetsmart.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -39,6 +40,8 @@ #include "valuedescconnect.h" #include +#include + #endif using namespace std; @@ -51,7 +54,7 @@ using namespace Action; ACTION_INIT(Action::ActivepointSetSmart); ACTION_SET_NAME(Action::ActivepointSetSmart,"activepoint_set_smart"); -ACTION_SET_LOCAL_NAME(Action::ActivepointSetSmart,_("Set Activepoint (Smart)")); +ACTION_SET_LOCAL_NAME(Action::ActivepointSetSmart,N_("Set Activepoint (Smart)")); ACTION_SET_TASK(Action::ActivepointSetSmart,"set"); ACTION_SET_CATEGORY(Action::ActivepointSetSmart,Action::CATEGORY_ACTIVEPOINT); ACTION_SET_PRIORITY(Action::ActivepointSetSmart,0); @@ -98,17 +101,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 @@ -284,7 +286,7 @@ Action::ActivepointSetSmart::prepare() clear(); times.clear(); - // First, we need to to add any activepoints necessary to + // First, we need to add any activepoints necessary to // maintain the integrity of the keyframes. enclose_activepoint(activepoint); @@ -293,7 +295,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()); @@ -361,5 +363,5 @@ Action::ActivepointSetSmart::prepare() catch(int){} catch(Exception::NotFound){} - throw Error(_("Unable to determine how to procede. This is a bug.")); + throw Error(_("Unable to determine how to proceed. This is a bug.")); }