Skip to content

Commit

Permalink
[composer] Don't consider removed items in z list
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro authored and nyalldawson committed May 15, 2014
1 parent d8761de commit 24ce745
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions src/core/composer/qgscomposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1193,12 +1193,19 @@ void QgsComposition::raiseItem( QgsComposerItem* item )
QMutableLinkedListIterator<QgsComposerItem*> it( mItemZList );
if ( it.findNext( item ) )
{
if ( it.hasNext() )
it.remove();
while ( it.hasNext() )
{
it.remove();
//search through item z list to find next item which is present in the scene
//(deleted items still exist in the z list so that they can be restored to their correct stacking order,
//but since they are not in the scene they should be ignored here)
it.next();
it.insert( item );
if ( it.value() && it.value()->scene() )
{
break;
}
}
it.insert( item );
}
}

Expand Down Expand Up @@ -1291,13 +1298,19 @@ void QgsComposition::lowerItem( QgsComposerItem* item )
QMutableLinkedListIterator<QgsComposerItem*> it( mItemZList );
if ( it.findNext( item ) )
{
it.previous();
if ( it.hasPrevious() )
it.remove();
while ( it.hasPrevious() )
{
it.remove();
//search through item z list to find previous item which is present in the scene
//(deleted items still exist in the z list so that they can be restored to their correct stacking order,
//but since they are not in the scene they should be ignored here)
it.previous();
it.insert( item );
if ( it.value() && it.value()->scene() )
{
break;
}
}
it.insert( item );
}
}

Expand Down

0 comments on commit 24ce745

Please sign in to comment.