Don't fail if we can't find the row in the param panel for the waypoint - it probably...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 5 Feb 2008 11:40:45 +0000 (11:40 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 5 Feb 2008 11:40:45 +0000 (11:40 +0000)
git-svn-id: http://svn.voria.com/code@1593 1f10aa63-cdf2-0310-b900-c93c546f37ac

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

index b3dc0bf..ee68669 100644 (file)
@@ -373,36 +373,22 @@ public:
                                                                          synfig::Waypoint::Side side)
        {
                std::set<synfig::Waypoint, std::less<UniqueID> > waypoint_set;
-               int n=synfig::waypoint_collect(waypoint_set,time,node);
+               synfig::waypoint_collect(waypoint_set,time,node);
 
                synfigapp::ValueDesc value_desc;
-               bool first = true;
-               if(!waypoint_set.empty())
-               {
-                       for (std::set<synfig::Waypoint, std::less<UniqueID> >::iterator iter = waypoint_set.begin(); iter != waypoint_set.end(); iter++)
-                       {
-                               ValueNode::Handle value_node(iter->get_parent_value_node());
-                               assert(value_node);
-
-                               Gtk::TreeRow row;
-                               if(!param_tree_store_->find_first_value_node(value_node, row))
-                               {
-                                       synfig::error(__FILE__":%d: Unable to find the valuenode",__LINE__);
-                                       return;
-                               }
 
-                               if(!row)
-                                       return;
+               if (waypoint_set.size() == 1)
+               {
+                       ValueNode::Handle value_node(waypoint_set.begin()->get_parent_value_node());
+                       assert(value_node);
 
-                               if (first)
-                               {
-                                       value_desc = static_cast<synfigapp::ValueDesc>(row[model.value_desc]);
-                                       first = false;
-                               }
-                       }
+                       Gtk::TreeRow row;
+                       if (param_tree_store_->find_first_value_node(value_node, row) && row)
+                               value_desc = static_cast<synfigapp::ValueDesc>(row[model.value_desc]);
+               }
 
+               if (!waypoint_set.empty())
                        signal_waypoint_clicked_timetrackview(value_desc,waypoint_set,button,side);
-               }
        }
 };