Fix 2378787: "two waypoints created from a single edit".
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 3 Dec 2008 17:52:45 +0000 (17:52 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 3 Dec 2008 17:52:45 +0000 (17:52 +0000)
git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2308 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/cellrenderer_value.cpp
synfig-studio/trunk/src/gtkmm/cellrenderer_value.h

index 34af34e..456dee7 100644 (file)
@@ -509,6 +509,7 @@ CellRenderer_ValueBase::start_editing_vfunc(
        const Gdk::Rectangle& cell_area __attribute__ ((unused)),
        Gtk::CellRendererState flags __attribute__ ((unused)))
 {
+       edit_value_done_called = false;
        // If we aren't editable, then there is nothing to do
        if(!property_editable())
                return 0;
@@ -581,6 +582,14 @@ CellRenderer_ValueBase::start_editing_vfunc(
 void
 CellRenderer_ValueBase::on_value_editing_done()
 {
+       if (edit_value_done_called)
+       {
+               synfig::error("on_value_editing_done(): Called twice!");
+               return;
+       }
+
+       edit_value_done_called = true;
+
        if(value_entry)
        {
                ValueBase old_value(property_value_.get_value());
index 4aba7b9..14a425d 100644 (file)
@@ -87,6 +87,7 @@ class CellRenderer_ValueBase : public Gtk::CellRendererText
        void gradient_edited(synfig::Gradient gradient, Glib::ustring path);
        void color_edited(synfig::Color color, Glib::ustring path);
 
+       bool edit_value_done_called;
 public:
        sigc::signal<void, const Glib::ustring&> &signal_secondary_click()
        {return signal_secondary_click_; }