=== modified file 'src/selection-chemistry.cpp' --- src/selection-chemistry.cpp 2013-03-25 17:42:31 +0000 +++ src/selection-chemistry.cpp 2013-04-09 18:40:14 +0000 @@ -250,6 +250,36 @@ } } +/* + * 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 === modified file 'src/selection-chemistry.h' --- src/selection-chemistry.h 2013-03-14 01:33:10 +0000 +++ src/selection-chemistry.h 2013-04-08 03:15:30 +0000 @@ -47,6 +47,7 @@ static void reverse(SPDesktop *dt); static void selectNext(SPDesktop *desktop); static void selectPrev(SPDesktop *desktop); + static void fixSelection(SPDesktop *desktop); }; } // namespace Inkscape === modified file 'src/ui/dialog/layers.cpp' --- src/ui/dialog/layers.cpp 2013-02-23 13:57:26 +0000 +++ src/ui/dialog/layers.cpp 2013-04-09 18:39:49 +0000 @@ -41,6 +41,7 @@ #include "xml/repr.h" #include "sp-root.h" #include "event-context.h" +#include "selection-chemistry.h" //#define DUMP_LAYERS 1 @@ -536,6 +537,7 @@ break; } } + Inkscape::SelectionHelper::fixSelection(_desktop); } bool LayersPanel::_handleKeyEvent(GdkEventKey *event)