summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2014-03-08 16:02:21 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2014-03-08 16:02:21 +0000
commitcf86d4abd17be00d1d148258053d9a1193e3c93d (patch)
tree42f9db74b83b6fcfd842dec3aae29582731f1c45
parentUpdate attributes unit test, expand style unit test and fix bug found. (diff)
downloadinkscape-cf86d4abd17be00d1d148258053d9a1193e3c93d.tar.gz
inkscape-cf86d4abd17be00d1d148258053d9a1193e3c93d.zip
Fix crashes caused by the desktop's query_style signal being called before
the selection's changed signal was processed in the text tool. Also fix similar crashes in the gradient dragger. Fixes LP #1271004. Fixed bugs: - https://launchpad.net/bugs/1271004 (bzr r13129)
-rw-r--r--src/gradient-drag.cpp4
-rw-r--r--src/selection.h8
-rw-r--r--src/ui/tools/text-tool.cpp4
3 files changed, 12 insertions, 4 deletions
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index 0b250fe52..6773069de 100644
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
@@ -636,13 +636,13 @@ GrDrag::GrDrag(SPDesktop *desktop) :
style_set_connection(),
style_query_connection()
{
- sel_changed_connection = selection->connectChanged(
+ sel_changed_connection = selection->connectChangedFirst(
sigc::bind(
sigc::ptr_fun(&gr_drag_sel_changed),
(gpointer)this )
);
- sel_modified_connection = selection->connectModified(
+ sel_modified_connection = selection->connectModifiedFirst(
sigc::bind(
sigc::ptr_fun(&gr_drag_sel_modified),
(gpointer)this )
diff --git a/src/selection.h b/src/selection.h
index 394ab64ff..373167a33 100644
--- a/src/selection.h
+++ b/src/selection.h
@@ -302,6 +302,10 @@ public:
sigc::connection connectChanged(sigc::slot<void, Selection *> const &slot) {
return _changed_signal.connect(slot);
}
+ sigc::connection connectChangedFirst(sigc::slot<void, Selection *> const &slot)
+ {
+ return _changed_signal.slots().insert(_changed_signal.slots().begin(), slot);
+ }
/**
* Connects a slot to be notified of selected object modifications.
@@ -319,6 +323,10 @@ public:
{
return _modified_signal.connect(slot);
}
+ sigc::connection connectModifiedFirst(sigc::slot<void, Selection *, guint> const &slot)
+ {
+ return _modified_signal.slots().insert(_modified_signal.slots().begin(), slot);
+ }
private:
/** no copy. */
diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp
index bf37937c4..ac830fe6b 100644
--- a/src/ui/tools/text-tool.cpp
+++ b/src/ui/tools/text-tool.cpp
@@ -180,10 +180,10 @@ void TextTool::setup() {
this->shape_editor->set_item(item, SH_KNOTHOLDER);
}
- this->sel_changed_connection = sp_desktop_selection(desktop)->connectChanged(
+ this->sel_changed_connection = sp_desktop_selection(desktop)->connectChangedFirst(
sigc::mem_fun(*this, &TextTool::_selectionChanged)
);
- this->sel_modified_connection = sp_desktop_selection(desktop)->connectModified(
+ this->sel_modified_connection = sp_desktop_selection(desktop)->connectModifiedFirst(
sigc::mem_fun(*this, &TextTool::_selectionModified)
);
this->style_set_connection = desktop->connectSetStyle(