Skip to content
Permalink
Browse files

Fix some Coverity null pointer dereference warnings

  • Loading branch information
nyalldawson committed Apr 3, 2018
1 parent 09241ea commit 2b04c813ba365adda569d581a91dbb6b36e46fa2
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/app/layout/qgslayoutdesignerdialog.cpp
@@ -3003,7 +3003,7 @@ void QgsLayoutDesignerDialog::exportReportToRaster()
QFileInfo fi( fileNExt.first );
QString dir = fi.path();
QString fileName = dir + '/' + fi.baseName();
QgsLayoutExporter::ExportResult result = QgsLayoutExporter::exportToImage( dynamic_cast< QgsReport * >( mMasterLayout ), fileName, fileNExt.second, settings, error, feedback.get() );
QgsLayoutExporter::ExportResult result = QgsLayoutExporter::exportToImage( static_cast< QgsReport * >( mMasterLayout ), fileName, fileNExt.second, settings, error, feedback.get() );
cursorOverride.release();

switch ( result )
@@ -3118,7 +3118,7 @@ void QgsLayoutDesignerDialog::exportReportToSvg()
QFileInfo fi( outputFileName );
QString outFile = fi.path() + '/' + fi.baseName();
QString dir = fi.path();
QgsLayoutExporter::ExportResult result = QgsLayoutExporter::exportToSvg( dynamic_cast< QgsReport * >( mMasterLayout ), outFile, svgSettings, error, feedback.get() );
QgsLayoutExporter::ExportResult result = QgsLayoutExporter::exportToSvg( static_cast< QgsReport * >( mMasterLayout ), outFile, svgSettings, error, feedback.get() );

cursorOverride.release();
switch ( result )
@@ -3249,7 +3249,7 @@ void QgsLayoutDesignerDialog::exportReportToPdf()
feedback->cancel();
} );

QgsLayoutExporter::ExportResult result = QgsLayoutExporter::exportToPdf( dynamic_cast< QgsReport * >( mMasterLayout ), outputFileName, pdfSettings, error, feedback.get() );
QgsLayoutExporter::ExportResult result = QgsLayoutExporter::exportToPdf( static_cast< QgsReport * >( mMasterLayout ), outputFileName, pdfSettings, error, feedback.get() );
cursorOverride.release();

switch ( result )
@@ -3346,7 +3346,7 @@ void QgsLayoutDesignerDialog::printReport()
} );

QString printerName = printer()->printerName();
switch ( QgsLayoutExporter::print( dynamic_cast< QgsReport * >( mMasterLayout ), *printer(), printSettings, error, feedback.get() ) )
switch ( QgsLayoutExporter::print( static_cast< QgsReport * >( mMasterLayout ), *printer(), printSettings, error, feedback.get() ) )
{
case QgsLayoutExporter::Success:
{
@@ -3552,6 +3552,9 @@ void QgsLayoutDesignerDialog::createLayoutPropertiesWidget()
void QgsLayoutDesignerDialog::createAtlasWidget()
{
QgsPrintLayout *printLayout = dynamic_cast< QgsPrintLayout * >( mMasterLayout );
if ( !printLayout )
return;

QgsLayoutAtlas *atlas = printLayout->atlas();
QgsLayoutAtlasWidget *atlasWidget = new QgsLayoutAtlasWidget( mAtlasDock, printLayout );
atlasWidget->setMessageBar( mMessageBar );

0 comments on commit 2b04c81

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