Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Select previously locked items after running Unlock All
  • Loading branch information
nyalldawson authored and mhugent committed Sep 17, 2013
1 parent 082d497 commit 90e0fad
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/composer/qgscomposition.cpp
Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 90e0fad

Please sign in to comment.