Browse Source

Actually handle svg plot job failure correctly

pcb_db
Marek Roszko 11 months ago
parent
commit
1d063e1420
  1. 16
      pcbnew/exporters/export_svg.cpp
  2. 8
      pcbnew/pcbnew_jobs_handler.cpp

16
pcbnew/exporters/export_svg.cpp

@ -117,13 +117,17 @@ bool EXPORT_SVG::Plot( BOARD* aBoard, const PCB_PLOT_SVG_OPTIONS& aSvgPlotOption
plotter->SetColorMode( !aSvgPlotOptions.m_blackAndWhite );
PlotBoardLayers( aBoard, plotter, aSvgPlotOptions.m_printMaskLayer, plot_opts );
plotter->EndPlot();
}
delete plotter;
delete plotter;
// reset to the values saved earlier
aBoard->GetDesignSettings().SetAuxOrigin( savedAuxOrigin );
aBoard->SetPageSettings( savedPageInfo );
// reset to the values saved earlier
aBoard->GetDesignSettings().SetAuxOrigin( savedAuxOrigin );
aBoard->SetPageSettings( savedPageInfo );
return true;
return true;
}
else
{
return false;
}
}

8
pcbnew/pcbnew_jobs_handler.cpp

@ -651,11 +651,15 @@ int PCBNEW_JOBS_HANDLER::JobExportSvg( JOB* aJob )
brd->SynchronizeProperties();
if( EXPORT_SVG::Plot( brd, svgPlotOptions ) )
{
m_reporter->Report( _( "Successfully created svg file" ) + wxS( "\n" ), RPT_SEVERITY_INFO );
return CLI::EXIT_CODES::OK;
}
else
{
m_reporter->Report( _( "Error creating svg file" ) + wxS( "\n" ), RPT_SEVERITY_ERROR );
return CLI::EXIT_CODES::OK;
return CLI::EXIT_CODES::ERR_INVALID_OUTPUT_CONFLICT;
}
}

Loading…
Cancel
Save