Skip to content

Commit

Permalink
Fix layout display when canceling export settings dialogs
Browse files Browse the repository at this point in the history
(cherry picked from commit d7b4182)
  • Loading branch information
nyalldawson committed Dec 11, 2018
1 parent 39df267 commit 93fd5de
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/app/layout/qgslayoutdesignerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2066,13 +2066,13 @@ void QgsLayoutDesignerDialog::exportToPdf()

setLastExportPath( outputFileName );

mView->setPaintingEnabled( false );
QgsTemporaryCursorOverride cursorOverride( Qt::BusyCursor );

QgsLayoutExporter::PdfExportSettings pdfSettings;
if ( !getPdfExportSettings( pdfSettings ) )
return;

mView->setPaintingEnabled( false );
QgsTemporaryCursorOverride cursorOverride( Qt::BusyCursor );

QgsProxyProgressTask *proxyTask = new QgsProxyProgressTask( tr( "Exporting “%1”" ).arg( mMasterLayout->name() ) );
QgsApplication::taskManager()->addTask( proxyTask );

Expand Down Expand Up @@ -2969,13 +2969,12 @@ void QgsLayoutDesignerDialog::exportAtlasToPdf()
outputFileName = QDir( dir ).filePath( QStringLiteral( "atlas" ) ); // filename is overridden by atlas
}

mView->setPaintingEnabled( false );
QgsTemporaryCursorOverride cursorOverride( Qt::BusyCursor );

QgsLayoutExporter::PdfExportSettings pdfSettings;
if ( !getPdfExportSettings( pdfSettings ) )
return;

mView->setPaintingEnabled( false );
QgsTemporaryCursorOverride cursorOverride( Qt::BusyCursor );
pdfSettings.rasterizeWholeImage = mLayout->customProperty( QStringLiteral( "rasterize" ), false ).toBool();

QString error;
Expand Down Expand Up @@ -3347,9 +3346,6 @@ void QgsLayoutDesignerDialog::exportReportToPdf()
}
setLastExportPath( outputFileName );

mView->setPaintingEnabled( false );
QgsTemporaryCursorOverride cursorOverride( Qt::BusyCursor );

bool rasterize = false;
if ( mLayout )
{
Expand All @@ -3359,6 +3355,9 @@ void QgsLayoutDesignerDialog::exportReportToPdf()
if ( !getPdfExportSettings( pdfSettings ) )
return;

mView->setPaintingEnabled( false );
QgsTemporaryCursorOverride cursorOverride( Qt::BusyCursor );

pdfSettings.rasterizeWholeImage = rasterize;

QString error;
Expand Down

0 comments on commit 93fd5de

Please sign in to comment.