Skip to content

Commit

Permalink
Fix layout display when canceling export settings dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 11, 2018
1 parent 1ccbdb8 commit 88077e4
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/app/layout/qgslayoutdesignerdialog.cpp
Expand Up @@ -2064,13 +2064,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 @@ -2967,13 +2967,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 @@ -3345,9 +3344,6 @@ void QgsLayoutDesignerDialog::exportReportToPdf()
}
setLastExportPath( outputFileName );

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

bool rasterize = false;
if ( mLayout )
{
Expand All @@ -3357,6 +3353,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 88077e4

Please sign in to comment.