summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp24
1 files changed, 13 insertions, 11 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"));
}
/*