Make sure Gerber print options have a color settings.

We probably don't need it, but some code attempts to dereference
it so safer to have one then to start checking everywhere for
dereferences.

Fixes https://gitlab.com/kicad/code/kicad/issues/5353
This commit is contained in:
Jeff Young 2020-08-25 14:07:18 +01:00
parent d02ce77bee
commit d1371e513d
4 changed files with 12 additions and 8 deletions

View File

@ -65,8 +65,9 @@ void BOARD_PRINTOUT_SETTINGS::Save( APP_SETTINGS_BASE* aConfig )
BOARD_PRINTOUT::BOARD_PRINTOUT( const BOARD_PRINTOUT_SETTINGS& aParams,
const KIGFX::VIEW* aView, const wxString& aTitle ) :
wxPrintout( aTitle ), m_settings( aParams )
const KIGFX::VIEW* aView, const wxString& aTitle ) :
wxPrintout( aTitle ),
m_settings( aParams )
{
m_view = aView;
}

View File

@ -28,7 +28,9 @@ static constexpr double MIN_SCALE = 0.01;
static constexpr double MAX_SCALE = 100.0;
DIALOG_PRINT_GENERIC::DIALOG_PRINT_GENERIC( EDA_DRAW_FRAME* aParent, PRINTOUT_SETTINGS* aSettings )
: DIALOG_PRINT_GENERIC_BASE( aParent ), m_config( nullptr ), m_settings( aSettings )
: DIALOG_PRINT_GENERIC_BASE( aParent ),
m_config( nullptr ),
m_settings( aSettings )
{
// Note: for the validator, min value is 0.0, to allow typing values like 0.5
// that start by 0

View File

@ -102,8 +102,10 @@ private:
};
DIALOG_PRINT_GERBVIEW::DIALOG_PRINT_GERBVIEW( GERBVIEW_FRAME* aParent, BOARD_PRINTOUT_SETTINGS* aSettings ) :
DIALOG_PRINT_GENERIC( aParent, aSettings ), m_parent( aParent )
DIALOG_PRINT_GERBVIEW::DIALOG_PRINT_GERBVIEW( GERBVIEW_FRAME* aParent,
BOARD_PRINTOUT_SETTINGS* aSettings ) :
DIALOG_PRINT_GENERIC( aParent, aSettings ),
m_parent( aParent )
{
m_config = Kiface().KifaceSettings();
@ -307,6 +309,7 @@ int GERBVIEW_CONTROL::Print( const TOOL_EVENT& aEvent )
m_toolMgr->RunAction( GERBVIEW_ACTIONS::selectionClear, true );
BOARD_PRINTOUT_SETTINGS settings( m_frame->GetPageSettings() );
settings.m_colorSettings = m_frame->GetColorSettings();
DIALOG_PRINT_GERBVIEW dlg( m_frame, &settings );
dlg.ForcePrintBorder( false );
dlg.ShowModal();

View File

@ -23,7 +23,6 @@
*/
#include <fctsys.h>
#include <pgm_base.h>
#include <gr_basic.h>
#include <base_units.h>
#include <base_screen.h>
@ -31,14 +30,13 @@
#include <gerber_file_image.h>
#include <gerber_file_image_list.h>
#include "gerbview_printout.h"
#include <gal/gal_print.h>
#include <view/view.h>
#include <gerbview_painter.h>
#include <math/util.h> // for KiROUND
GERBVIEW_PRINTOUT::GERBVIEW_PRINTOUT( GBR_LAYOUT* aLayout, const BOARD_PRINTOUT_SETTINGS& aParams,
const KIGFX::VIEW* aView, const wxString& aTitle ) :
const KIGFX::VIEW* aView, const wxString& aTitle ) :
BOARD_PRINTOUT( aParams, aView, aTitle )
{
m_layout = aLayout;