diff options
Diffstat (limited to 'src/widgets/toolbox.cpp')
| -rw-r--r-- | src/widgets/toolbox.cpp | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index d2753fadf..0b37aa610 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -863,23 +863,6 @@ static void trigger_sp_action( GtkAction* /*act*/, gpointer user_data ) } } -static void sp_action_action_set_sensitive(SPAction * /*action*/, unsigned int sensitive, void *data) -{ - if ( data ) { - GtkAction* act = GTK_ACTION(data); - gtk_action_set_sensitive( act, sensitive ); - } -} - -static SPActionEventVector action_event_vector = { - {NULL}, - NULL, - NULL, - sp_action_action_set_sensitive, - NULL, - NULL -}; - static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::View::View* view, Inkscape::IconSize size ) { GtkAction* act = 0; @@ -891,8 +874,13 @@ static GtkAction* create_action_for_verb( Inkscape::Verb* verb, Inkscape::UI::Vi g_signal_connect( G_OBJECT(inky), "activate", G_CALLBACK(trigger_sp_action), targetAction ); - SPAction*rebound = dynamic_cast<SPAction *>( nr_object_ref( dynamic_cast<NRObject *>(targetAction) ) ); - nr_active_object_add_listener( (NRActiveObject *)rebound, (NRObjectEventVector *)&action_event_vector, sizeof(SPActionEventVector), inky ); + // FIXME: memory leak: this is not unrefed anywhere + g_object_ref(G_OBJECT(targetAction)); + g_object_set_data_full(G_OBJECT(inky), "SPAction", (void*) targetAction, (GDestroyNotify) &g_object_unref); + targetAction->signal_set_sensitive.connect( + sigc::bind<0>( + sigc::ptr_fun(>k_action_set_sensitive), + GTK_ACTION(inky))); return act; } @@ -5950,7 +5938,7 @@ static void lpetool_toggle_set_bbox(GtkToggleAction *act, gpointer data) SPDesktop *desktop = static_cast<SPDesktop *>(data); Inkscape::Selection *selection = desktop->selection; - Geom::OptRect bbox = selection->bounds(); + Geom::OptRect bbox = selection->visualBounds(); if (bbox) { Geom::Point A(bbox->min()); @@ -6798,8 +6786,7 @@ static void sp_text_align_mode_changed( EgeSelectOneAction *act, GObject *tbl ) axis = Geom::Y; } - Geom::OptRect bbox - = item->getBounds(Geom::identity(), SPItem::GEOMETRIC_BBOX); + Geom::OptRect bbox = item->geometricBounds(); if (!bbox) continue; double width = bbox->dimensions()[axis]; |
