Skip to content
Permalink
Browse files
[composer] Don't consider removed items in z list
  • Loading branch information
manisandro authored and nyalldawson committed May 15, 2014
1 parent d8761de commit 24ce7456f496a3b5edc9d57f2732545bcffa1c5e
Showing with 20 additions and 7 deletions.
  1. +20 −7 src/core/composer/qgscomposition.cpp
@@ -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 );
}
}

@@ -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 );
}
}

0 comments on commit 24ce745

Please sign in to comment.