Skip to content
Permalink
Browse files

Avoid creating undo commands when converting compositions

  • Loading branch information
nyalldawson committed Jan 17, 2018
1 parent 4a2da50 commit 163c2784916b557a23cc88b487bca6fc8400e5f1
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/core/layout/qgscompositionconverter.cpp
@@ -33,6 +33,7 @@
#include "qgsprintlayout.h"
#include "qgslayoutatlas.h"

#include "qgslayoutundostack.h"
#include "qgslayoutpagecollection.h"
#include "qgslayoutitemregistry.h"
#include "qgslayoutitemlabel.h"
@@ -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 );
@@ -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;
}

0 comments on commit 163c278

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