Skip to content
Permalink
Browse files

Save annotations to project.qgs in creation order (fix #14812)

Save annotations to project file in the order they were loaded or
created, so that annotations have the same display order each
time the project is opened.

(cherry-picked from 82d465c)
  • Loading branch information
nyalldawson committed May 19, 2016
1 parent a2756b9 commit e63e9eb89240fccfee1d5a4d88cc7c7dc87cbf51
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/app/qgisapp.cpp
@@ -1574,14 +1574,19 @@ void QgisApp::showStyleManagerV2()
void QgisApp::writeAnnotationItemsToProject( QDomDocument& doc )
{
QList<QgsAnnotationItem*> items = annotationItems();
QList<QgsAnnotationItem*>::const_iterator itemIt = items.constBegin();
for ( ; itemIt != items.constEnd(); ++itemIt )
QgsAnnotationItem* item;
QListIterator<QgsAnnotationItem*> i( items );
// save lowermost annotation (at end of list) first
i.toBack();
while ( i.hasPrevious() )
{
if ( ! *itemIt )
item = i.previous();

if ( ! item )
{
continue;
}
( *itemIt )->writeXML( doc );
item->writeXML( doc );
}
}

0 comments on commit e63e9eb

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