summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-05-16 16:29:10 +0000
committerJabiertxo Arraiza Zenotz <jtx@jtx.marker.es>2013-05-16 16:29:10 +0000
commitb0d75ca0f9aea3c7652042d1a6300bbfdf1391e8 (patch)
treefe0c3c3eb28289ad60a96ab65ff6954576834ddc /src/selection-chemistry.cpp
parentChange only selected nodes (diff)
parentWin32. More include fixes for glibmm 2.36 (file dialog). (diff)
downloadinkscape-b0d75ca0f9aea3c7652042d1a6300bbfdf1391e8.tar.gz
inkscape-b0d75ca0f9aea3c7652042d1a6300bbfdf1391e8.zip
Update to trunk
(bzr r11950.1.114)
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