diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2013-09-23 22:11:51 +0000 |
|---|---|---|
| committer | Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl> | 2013-09-23 22:11:51 +0000 |
| commit | 62b2cd734e684a93d1b9215aa8044c620939170d (patch) | |
| tree | 001d2dd71c7d077124519ac4dc0cf1e91fbaa36a /src/ui/widget | |
| parent | Added missing registration of FeDistantLight; made sure warnings on missing t... (diff) | |
| download | inkscape-62b2cd734e684a93d1b9215aa8044c620939170d.tar.gz inkscape-62b2cd734e684a93d1b9215aa8044c620939170d.zip | |
fix crash on uninitialized unittracker for spinbuttons. fixes crash on changing major grid line number, possibly other random crashes
Fixed bugs:
- https://launchpad.net/bugs/1229183
(bzr r12581)
Diffstat (limited to 'src/ui/widget')
| -rw-r--r-- | src/ui/widget/spinbutton.cpp | 4 | ||||
| -rw-r--r-- | src/ui/widget/spinbutton.h | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/ui/widget/spinbutton.cpp b/src/ui/widget/spinbutton.cpp index 62c17f821..1114ff32b 100644 --- a/src/ui/widget/spinbutton.cpp +++ b/src/ui/widget/spinbutton.cpp @@ -65,7 +65,7 @@ int SpinButton::on_input(double* newvalue) bool SpinButton::on_my_focus_in_event(GdkEventFocus* /*event*/) { - on_focus_in_value = get_value(); + _on_focus_in_value = get_value(); return false; // do not consume the event } @@ -92,7 +92,7 @@ bool SpinButton::on_my_key_press_event(GdkEventKey* event) void SpinButton::undo() { - set_value(on_focus_in_value); + set_value(_on_focus_in_value); } diff --git a/src/ui/widget/spinbutton.h b/src/ui/widget/spinbutton.h index c772fe2a2..812b5f515 100644 --- a/src/ui/widget/spinbutton.h +++ b/src/ui/widget/spinbutton.h @@ -38,7 +38,9 @@ class SpinButton : public Gtk::SpinButton public: SpinButton(double climb_rate = 0.0, guint digits = 0) : Gtk::SpinButton(climb_rate, digits), - _unit_menu(NULL) + _unit_menu(NULL), + _unit_tracker(NULL), + _on_focus_in_value(0.) { connect_signals(); }; @@ -48,10 +50,11 @@ public: explicit SpinButton(Gtk::Adjustment& adjustment, double climb_rate = 0.0, guint digits = 0) #endif : Gtk::SpinButton(adjustment, climb_rate, digits), - _unit_menu(NULL) + _unit_menu(NULL), + _unit_tracker(NULL), + _on_focus_in_value(0.) { connect_signals(); - _unit_tracker = NULL; }; virtual ~SpinButton() {}; @@ -63,6 +66,7 @@ public: protected: UnitMenu *_unit_menu; /// Linked unit menu for unit conversion in entered expressions. UnitTracker *_unit_tracker; // Linked unit tracker for unit conversion in entered expressions. + double _on_focus_in_value; void connect_signals(); @@ -95,8 +99,6 @@ protected: */ void undo(); - double on_focus_in_value; - private: // noncopyable SpinButton(const SpinButton&); |
