Skip to content
Permalink
Browse files

Select previously locked items after running Unlock All

  • Loading branch information
nyalldawson authored and mhugent committed Sep 16, 2013
1 parent 082d497 commit 90e0fad62eb11124b487541c5f87031b96ebb456
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/core/composer/qgscomposition.cpp
@@ -1169,17 +1169,25 @@ void QgsComposition::lockSelectedItems()
void QgsComposition::unlockAllItems()
{
//unlock all items in composer

QUndoCommand* parentCommand = new QUndoCommand( tr( "Items unlocked" ) );

//first, clear the selection
clearSelection();

QList<QGraphicsItem *> itemList = items();
QList<QGraphicsItem *>::iterator itemIt = itemList.begin();
for ( ; itemIt != itemList.end(); ++itemIt )
{
QgsComposerItem* mypItem = dynamic_cast<QgsComposerItem *>( *itemIt );
if ( mypItem )
if ( mypItem && mypItem->positionLock() )
{
QgsComposerItemCommand* subcommand = new QgsComposerItemCommand( mypItem, "", parentCommand );
subcommand->savePreviousState();
mypItem->setPositionLock( false );
//select unlocked items, same behaviour as illustrator
mypItem->setSelected( true );
emit selectedItemChanged( mypItem );
subcommand->saveAfterState();
}
}

0 comments on commit 90e0fad

Please sign in to comment.
You can’t perform that action at this time.