Skip to content

Commit

Permalink
Avoid creating undo commands when converting compositions
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 17, 2018
1 parent 4a2da50 commit 163c278
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/layout/qgscompositionconverter.cpp
Expand Up @@ -33,6 +33,7 @@
#include "qgsprintlayout.h"
#include "qgslayoutatlas.h"

#include "qgslayoutundostack.h"
#include "qgslayoutpagecollection.h"
#include "qgslayoutitemregistry.h"
#include "qgslayoutitemlabel.h"
Expand Down Expand Up @@ -122,6 +123,7 @@ std::unique_ptr< QgsPrintLayout > QgsCompositionConverter::createLayoutFromCompo
QDomElement parentElement = composerElement.parentNode().toElement();

std::unique_ptr< QgsPrintLayout > layout = qgis::make_unique< QgsPrintLayout >( project );
layout->undoStack()->blockCommands( true );

// Guides
layout->guides().setVisible( composerElement.attribute( QStringLiteral( "guidesVisible" ), QStringLiteral( "1" ) ).toInt() != 0 );
Expand Down Expand Up @@ -179,6 +181,8 @@ std::unique_ptr< QgsPrintLayout > QgsCompositionConverter::createLayoutFromCompo
QDomElement atlasElement = parentElement.elementsByTagName( QStringLiteral( "Atlas" ) ).at( 0 ).toElement();
readAtlasXml( layout->atlas(), atlasElement, layout->project() );
}

layout->undoStack()->blockCommands( false );
return layout;
}

Expand Down

0 comments on commit 163c278

Please sign in to comment.