From: acspike Date: Mon, 12 Mar 2007 04:31:44 +0000 (+0000) Subject: move sp_document_done() out into verbs.cpp X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ae5f1fd7d2a6e7e8e539730ad56476c26e459ecd;p=inkscape.git move sp_document_done() out into verbs.cpp --- diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index ead154466..00ef48766 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -2895,10 +2895,8 @@ static void unhide(SPItem *item, SPDesktop *desktop) { } } -static void process_all(void (*f)(SPItem *, SPDesktop *), SPDesktop *dt, unsigned int id, bool layer_only, char *label) { +static void process_all(void (*f)(SPItem *, SPDesktop *), SPDesktop *dt, bool layer_only) { if (!dt) return; - SPDocument *doc = sp_desktop_document(dt); - if (!doc) return; SPObject *root; if (layer_only) { @@ -2908,24 +2906,22 @@ static void process_all(void (*f)(SPItem *, SPDesktop *), SPDesktop *dt, unsigne } itemtree_map(f, root, dt); - - sp_document_done(doc, id, label); } -void unlock_all(SPDesktop *dt, unsigned int id) { - process_all(&unlock, dt, id, true, _("Unlock all objects in the current layer")); +void unlock_all(SPDesktop *dt) { + process_all(&unlock, dt, true); } -void unlock_all_in_all_layers(SPDesktop *dt, unsigned int id) { - process_all(&unlock, dt, id, false, _("Unlock all objects in all layers")); +void unlock_all_in_all_layers(SPDesktop *dt) { + process_all(&unlock, dt, false); } -void unhide_all(SPDesktop *dt, unsigned int id) { - process_all(&unhide, dt, id, true, _("Unhide all objects in the current layer")); +void unhide_all(SPDesktop *dt) { + process_all(&unhide, dt, true); } -void unhide_all_in_all_layers(SPDesktop *dt, unsigned int id) { - process_all(&unhide, dt, id, false, _("Unhide all objects in all layers")); +void unhide_all_in_all_layers(SPDesktop *dt) { + process_all(&unhide, dt, false); } /* diff --git a/src/selection-chemistry.h b/src/selection-chemistry.h index 5a4ad194b..0ad465ec4 100644 --- a/src/selection-chemistry.h +++ b/src/selection-chemistry.h @@ -100,10 +100,10 @@ void fit_canvas_to_selection(SPDesktop *desktop); void fit_canvas_to_drawing(SPDocument *doc); void fit_canvas_to_selection_or_drawing(SPDesktop *desktop); -void unlock_all(SPDesktop *dt, unsigned int id); -void unlock_all_in_all_layers(SPDesktop *dt, unsigned int id); -void unhide_all(SPDesktop *dt, unsigned int id); -void unhide_all_in_all_layers(SPDesktop *dt, unsigned int id); +void unlock_all(SPDesktop *dt); +void unlock_all_in_all_layers(SPDesktop *dt); +void unhide_all(SPDesktop *dt); +void unhide_all_in_all_layers(SPDesktop *dt); /* selection cycling */ diff --git a/src/verbs.cpp b/src/verbs.cpp index 88b5f4e33..f88422407 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2013,19 +2013,25 @@ LockAndHideVerb::perform(SPAction *action, void *data, void *pdata) { SPDesktop *dt = static_cast(sp_action_get_view(action)); if (!dt) return; + SPDocument *doc = sp_desktop_document(dt); + if (!doc) return; switch ((long) data) { case SP_VERB_UNLOCK_ALL: - unlock_all(dt, SP_VERB_UNLOCK_ALL); + unlock_all(dt); + sp_document_done(doc, SP_VERB_UNLOCK_ALL, _("Unlock all objects in the current layer")); break; case SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS: - unlock_all_in_all_layers(dt, SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS); + unlock_all_in_all_layers(dt); + sp_document_done(doc, SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS, _("Unlock all objects in all layers")); break; case SP_VERB_UNHIDE_ALL: - unhide_all(dt, SP_VERB_UNHIDE_ALL); + unhide_all(dt); + sp_document_done(doc, SP_VERB_UNHIDE_ALL, _("Unhide all objects in the current layer")); break; case SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS: - unhide_all_in_all_layers(dt, SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS); + unhide_all_in_all_layers(dt); + sp_document_done(doc, SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS, _("Unhide all objects in all layers")); break; default: return;