summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
authorNicolas Dufour <nicoduf@yahoo.fr>2013-05-12 11:45:33 +0000
committerJazzyNico <nicoduf@yahoo.fr>2013-05-12 11:45:33 +0000
commit21ee7692231394923e753545733183e77d67df44 (patch)
tree87c160f6da18154766ceeeeca86ba124517e0b9d /src/selection-chemistry.cpp
parentFix for Bug #683561 (Can't select text using click - [SHIFT+click]). (diff)
downloadinkscape-21ee7692231394923e753545733183e77d67df44.tar.gz
inkscape-21ee7692231394923e753545733183e77d67df44.zip
Fix for Bug #181493 (Locked layers not completely locked) by frenchie4111.
Fixed bugs: - https://launchpad.net/bugs/181493 (bzr r12328)
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index d94b085a0..cd0001175 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -250,6 +250,36 @@ void SelectionHelper::selectPrev(SPDesktop *dt)
}
}
+/*
+ * Fixes the current selection, removing locked objects from it
+ */
+void SelectionHelper::fixSelection(SPDesktop *dt)
+{
+ if(!dt)
+ return;
+
+ Inkscape::Selection *selection = sp_desktop_selection(dt);
+
+ GSList *items = NULL;
+
+ GSList const *selList = selection->itemList();
+
+ for( GSList const *i = selList; i; i = i->next ) {
+ if( SP_IS_ITEM(i->data) &&
+ !dt->isLayer(SP_ITEM(i->data)) &&
+ (!SP_ITEM(i->data)->isLocked()))
+ {
+ items = g_slist_prepend(items, SP_ITEM(i->data));
+ }
+ }
+
+ selection->setList(items);
+
+ if(items) {
+ g_slist_free(items);
+ }
+}
+
} // namespace Inkscape