summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAaron Spike <aaron@ekips.org>2007-03-12 04:17:17 +0000
committeracspike <acspike@users.sourceforge.net>2007-03-12 04:17:17 +0000
commitff6b373c24e57e343556dd777c795bdc05b4dbfe (patch)
tree3106cca821ae3d4567cccf13e7d2c6c725ca837f /src
parentmove style reading/writing from SPItem up to SPObject (diff)
downloadinkscape-ff6b373c24e57e343556dd777c795bdc05b4dbfe.tar.gz
inkscape-ff6b373c24e57e343556dd777c795bdc05b4dbfe.zip
send verb ids into history and remove casting errors
(bzr r2615)
Diffstat (limited to 'src')
-rw-r--r--src/selection-chemistry.cpp24
-rw-r--r--src/selection-chemistry.h8
-rw-r--r--src/verbs.cpp8
3 files changed, 21 insertions, 19 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 7d22695fc..ead154466 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -2877,7 +2877,7 @@ static void itemtree_map(void (*f)(SPItem *, SPDesktop *), SPObject *root, SPDes
}
for ( SPObject::SiblingIterator iter = root->firstChild() ; iter ; ++iter ) {
//don't recurse into locked layers
- if (!(desktop->isLayer(SP_ITEM(&*iter)) && SP_ITEM(&*iter)->isLocked())) {
+ if (!(SP_IS_ITEM(&*iter) && desktop->isLayer(SP_ITEM(&*iter)) && SP_ITEM(&*iter)->isLocked())) {
itemtree_map(f, iter, desktop);
}
}
@@ -2895,8 +2895,10 @@ static void unhide(SPItem *item, SPDesktop *desktop) {
}
}
-static void process_all(void (*f)(SPItem *, SPDesktop *), SPDesktop *dt, bool layer_only, char *label) {
+static void process_all(void (*f)(SPItem *, SPDesktop *), SPDesktop *dt, unsigned int id, bool layer_only, char *label) {
if (!dt) return;
+ SPDocument *doc = sp_desktop_document(dt);
+ if (!doc) return;
SPObject *root;
if (layer_only) {
@@ -2907,23 +2909,23 @@ static void process_all(void (*f)(SPItem *, SPDesktop *), SPDesktop *dt, bool la
itemtree_map(f, root, dt);
- sp_document_done(SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM, label);
+ sp_document_done(doc, id, label);
}
-void unlock_all(SPDesktop *dt) {
- process_all(&unlock, dt, true, _("Unlock all objects in the current layer"));
+void unlock_all(SPDesktop *dt, unsigned int id) {
+ process_all(&unlock, dt, id, true, _("Unlock all objects in the current layer"));
}
-void unlock_all_in_all_layers(SPDesktop *dt) {
- process_all(&unlock, dt, false, _("Unlock all objects in all layers"));
+void unlock_all_in_all_layers(SPDesktop *dt, unsigned int id) {
+ process_all(&unlock, dt, id, false, _("Unlock all objects in all layers"));
}
-void unhide_all(SPDesktop *dt) {
- process_all(&unhide, dt, true, _("Unhide all objects in the current layer"));
+void unhide_all(SPDesktop *dt, unsigned int id) {
+ process_all(&unhide, dt, id, true, _("Unhide all objects in the current layer"));
}
-void unhide_all_in_all_layers(SPDesktop *dt) {
- process_all(&unhide, dt, false, _("Unhide all objects in all layers"));
+void unhide_all_in_all_layers(SPDesktop *dt, unsigned int id) {
+ process_all(&unhide, dt, id, false, _("Unhide all objects in all layers"));
}
/*
diff --git a/src/selection-chemistry.h b/src/selection-chemistry.h
index 0ad465ec4..5a4ad194b 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);
-void unlock_all_in_all_layers(SPDesktop *dt);
-void unhide_all(SPDesktop *dt);
-void unhide_all_in_all_layers(SPDesktop *dt);
+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);
/* selection cycling */
diff --git a/src/verbs.cpp b/src/verbs.cpp
index 91adfc7d0..88b5f4e33 100644
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
@@ -2016,16 +2016,16 @@ LockAndHideVerb::perform(SPAction *action, void *data, void *pdata)
switch ((long) data) {
case SP_VERB_UNLOCK_ALL:
- unlock_all(dt);
+ unlock_all(dt, SP_VERB_UNLOCK_ALL);
break;
case SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS:
- unlock_all_in_all_layers(dt);
+ unlock_all_in_all_layers(dt, SP_VERB_UNLOCK_ALL_IN_ALL_LAYERS);
break;
case SP_VERB_UNHIDE_ALL:
- unhide_all(dt);
+ unhide_all(dt, SP_VERB_UNHIDE_ALL);
break;
case SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS:
- unhide_all_in_all_layers(dt);
+ unhide_all_in_all_layers(dt, SP_VERB_UNHIDE_ALL_IN_ALL_LAYERS);
break;
default:
return;