diff options
| author | Martin Owens <doctormo@gmail.com> | 2013-08-12 17:14:38 +0000 |
|---|---|---|
| committer | Martin Owens <doctormo@gmail.com> | 2013-08-12 17:14:38 +0000 |
| commit | 870b75d81c82e7eea57134e9e4cd35734d443da2 (patch) | |
| tree | 32fadd87a5507b108c457db4da40d963c5c7b7e4 /src/verbs.cpp | |
| parent | Packaging. Hebrew translation by Yaron Shahrabani. (diff) | |
| parent | Allow Object to Path verb from non-GUI (DBus) interface (diff) | |
| download | inkscape-870b75d81c82e7eea57134e9e4cd35734d443da2.tar.gz inkscape-870b75d81c82e7eea57134e9e4cd35734d443da2.zip | |
Merge in object-to-path enabler dbus command
(bzr r12474)
Diffstat (limited to 'src/verbs.cpp')
| -rw-r--r-- | src/verbs.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/verbs.cpp b/src/verbs.cpp index 06e59be38..baac07d60 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1446,12 +1446,26 @@ void LayerVerb::perform(SPAction *action, void *data) */ void ObjectVerb::perform( SPAction *action, void *data) { - g_return_if_fail(ensure_desktop_valid(action)); SPDesktop *dt = sp_action_get_desktop(action); + Inkscape::Selection *sel = sp_action_get_selection(action); - SPEventContext *ec = dt->event_context; + // We can perform some actions without a desktop + bool handled = true; + switch (reinterpret_cast<std::size_t>(data)) { + case SP_VERB_OBJECT_TO_CURVE: + sp_selected_path_to_curves(sel, dt); + break; + default: + handled = false; + break; + } + if (handled) { + return; + } - Inkscape::Selection *sel = sp_desktop_selection(dt); + g_return_if_fail(ensure_desktop_valid(action)); + + SPEventContext *ec = dt->event_context; if (sel->isEmpty()) return; @@ -1478,9 +1492,6 @@ void ObjectVerb::perform( SPAction *action, void *data) case SP_VERB_OBJECT_FLATTEN: sp_selection_remove_transform(dt); break; - case SP_VERB_OBJECT_TO_CURVE: - sp_selected_path_to_curves(dt); - break; case SP_VERB_OBJECT_FLOW_TEXT: text_flow_into_shape(); break; |
