Merge pull request #39135 from elpaso/bugfix-gh39086-empty-report-crash

Fix crash when exporting empty report
This commit is contained in:
Alessandro Pasotti 2020-10-03 23:06:55 +02:00 committed by GitHub
commit 8cd40aeebf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -274,8 +274,11 @@ class QgsAtlasExportGuard
mDialog->mIsExportingAtlas = false; mDialog->mIsExportingAtlas = false;
// need to update the GUI to reflect the final atlas feature // need to update the GUI to reflect the final atlas feature
if ( mDialog->currentLayout() )
{
mDialog->atlasFeatureChanged( mDialog->currentLayout()->reportContext().feature() ); mDialog->atlasFeatureChanged( mDialog->currentLayout()->reportContext().feature() );
} }
}
private: private:
QgsLayoutDesignerDialog *mDialog = nullptr; QgsLayoutDesignerDialog *mDialog = nullptr;
@ -4655,6 +4658,7 @@ void QgsLayoutDesignerDialog::toggleActions( bool layoutAvailable )
mActionExportAsPDF->setEnabled( layoutAvailable ); mActionExportAsPDF->setEnabled( layoutAvailable );
mActionExportAsSVG->setEnabled( layoutAvailable ); mActionExportAsSVG->setEnabled( layoutAvailable );
mActionPrint->setEnabled( layoutAvailable ); mActionPrint->setEnabled( layoutAvailable );
mActionPrintReport->setEnabled( layoutAvailable );
mActionCut->setEnabled( layoutAvailable ); mActionCut->setEnabled( layoutAvailable );
mActionCopy->setEnabled( layoutAvailable ); mActionCopy->setEnabled( layoutAvailable );
mActionPaste->setEnabled( layoutAvailable ); mActionPaste->setEnabled( layoutAvailable );