Simplify the code. There's no need to check whether we're increasing or decreasing...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 20 Feb 2008 16:13:39 +0000 (16:13 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 20 Feb 2008 16:13:39 +0000 (16:13 +0000)
git-svn-id: http://svn.voria.com/code@1790 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/layeractionmanager.cpp

index 321a069..5b7834c 100644 (file)
@@ -491,21 +491,14 @@ LayerActionManager::amount_inc()
        float adjust(0.1);
 
        // Create the action group
-       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Decrease Amount"));
-
-       if(adjust>0)
-               group.set_name(_("Increase Amount"));
-
+       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Increase Amount"));
        synfigapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers());
 
-       while(!layer_list.empty())
+       for (; !layer_list.empty(); layer_list.pop_front())
        {
                ValueBase value(layer_list.front()->get_param("amount"));
                if(value.same_type_as(Real()))
-               {
                        get_canvas_interface()->change_value(synfigapp::ValueDesc(layer_list.front(),"amount"),value.get(Real())+adjust);
-               }
-               layer_list.pop_front();
        }
 }
 
@@ -516,19 +509,12 @@ LayerActionManager::amount_dec()
 
        // Create the action group
        synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Decrease Amount"));
-
-       if(adjust>0)
-               group.set_name(_("Increase Amount"));
-
        synfigapp::SelectionManager::LayerList layer_list(layer_tree_->get_selected_layers());
 
-       while(!layer_list.empty())
+       for (; !layer_list.empty(); layer_list.pop_front())
        {
                ValueBase value(layer_list.front()->get_param("amount"));
                if(value.same_type_as(Real()))
-               {
                        get_canvas_interface()->change_value(synfigapp::ValueDesc(layer_list.front(),"amount"),value.get(Real())+adjust);
-               }
-               layer_list.pop_front();
        }
 }