Commit 00ee6c7b authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew, dialog SVG export: Fix Pcbnew crash when opening the dialog.

parent d3f28fb7
...@@ -217,7 +217,7 @@ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysList, ...@@ -217,7 +217,7 @@ void Draw3D_SolidHorizontalPolyPolygons( const std::vector<CPolyPt>& aPolysList,
/* draw the solid polygon found in aPolysList /* draw the solid polygon found in aPolysList
* The first polygonj is the main polygon, others are holes * The first polygon is the main polygon, others are holes
* See Draw3D_SolidHorizontalPolyPolygons for more info * See Draw3D_SolidHorizontalPolyPolygons for more info
*/ */
void Draw3D_SolidHorizontalPolygonWithHoles( const std::vector<CPolyPt>& aPolysList, void Draw3D_SolidHorizontalPolygonWithHoles( const std::vector<CPolyPt>& aPolysList,
......
...@@ -118,11 +118,11 @@ void DIALOG_SVG_PRINT::initDialog() ...@@ -118,11 +118,11 @@ void DIALOG_SVG_PRINT::initDialog()
// (Front or Top to Back or Bottom) // (Front or Top to Back or Bottom)
DECLARE_LAYERS_ORDER_LIST( layersOrder ); DECLARE_LAYERS_ORDER_LIST( layersOrder );
for( LAYER_NUM layer_idx = FIRST_LAYER; layer_idx < NB_LAYERS; ++layer_idx ) for( LAYER_NUM layer_idx = FIRST_LAYER; layer_idx < NB_PCB_LAYERS; ++layer_idx )
{ {
layer = layersOrder[layer_idx]; layer = layersOrder[layer_idx];
wxASSERT( layer < NB_LAYERS ); wxASSERT( layer < NB_PCB_LAYERS );
if( m_boxSelectLayer[layer] == NULL ) if( m_boxSelectLayer[layer] == NULL )
continue; continue;
...@@ -148,7 +148,7 @@ void DIALOG_SVG_PRINT::initDialog() ...@@ -148,7 +148,7 @@ void DIALOG_SVG_PRINT::initDialog()
{ {
wxString layerKey; wxString layerKey;
for( LAYER_NUM layer = FIRST_LAYER; layer < NB_LAYERS; ++layer ) for( LAYER_NUM layer = FIRST_LAYER; layer < NB_PCB_LAYERS; ++layer )
{ {
bool option; bool option;
...@@ -237,7 +237,7 @@ void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile ) ...@@ -237,7 +237,7 @@ void DIALOG_SVG_PRINT::ExportSVGFile( bool aOnlyOneFile )
// Build layers mask // Build layers mask
LAYER_MSK printMaskLayer = NO_LAYERS; LAYER_MSK printMaskLayer = NO_LAYERS;
for( LAYER_NUM layer = FIRST_LAYER; layer < NB_LAYERS; ++layer ) for( LAYER_NUM layer = FIRST_LAYER; layer < NB_PCB_LAYERS; ++layer )
{ {
if( m_boxSelectLayer[layer] && m_boxSelectLayer[layer]->GetValue() ) if( m_boxSelectLayer[layer] && m_boxSelectLayer[layer]->GetValue() )
printMaskLayer |= GetLayerMask( layer ); printMaskLayer |= GetLayerMask( layer );
...@@ -363,7 +363,7 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event ) ...@@ -363,7 +363,7 @@ void DIALOG_SVG_PRINT::OnCloseWindow( wxCloseEvent& event )
wxString layerKey; wxString layerKey;
for( LAYER_NUM layer = FIRST_LAYER; layer<NB_LAYERS; ++layer ) for( LAYER_NUM layer = FIRST_LAYER; layer < NB_PCB_LAYERS; ++layer )
{ {
if( m_boxSelectLayer[layer] == NULL ) if( m_boxSelectLayer[layer] == NULL )
continue; continue;
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 10 2012) // C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -24,6 +24,7 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c ...@@ -24,6 +24,7 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
bSizer4 = new wxBoxSizer( wxHORIZONTAL ); bSizer4 = new wxBoxSizer( wxHORIZONTAL );
m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_outputDirectoryName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_outputDirectoryName->SetMaxLength( 0 );
m_outputDirectoryName->SetToolTip( _("Enter a filename if you do not want to use default file names\nCan be used only when printing the current sheet") ); m_outputDirectoryName->SetToolTip( _("Enter a filename if you do not want to use default file names\nCan be used only when printing the current sheet") );
m_outputDirectoryName->SetMinSize( wxSize( 450,-1 ) ); m_outputDirectoryName->SetMinSize( wxSize( 450,-1 ) );
...@@ -64,6 +65,7 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c ...@@ -64,6 +65,7 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
sbOptionsSizer->Add( m_TextPenWidth, 0, wxRIGHT|wxLEFT, 5 ); sbOptionsSizer->Add( m_TextPenWidth, 0, wxRIGHT|wxLEFT, 5 );
m_DialogDefaultPenSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_DialogDefaultPenSize = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_DialogDefaultPenSize->SetMaxLength( 0 );
sbOptionsSizer->Add( m_DialogDefaultPenSize, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); sbOptionsSizer->Add( m_DialogDefaultPenSize, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and white") }; wxString m_ModeColorOptionChoices[] = { _("Color"), _("Black and white") };
...@@ -118,6 +120,7 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c ...@@ -118,6 +120,7 @@ DIALOG_SVG_PRINT_base::DIALOG_SVG_PRINT_base( wxWindow* parent, wxWindowID id, c
bMainSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bMainSizer->Add( m_staticText2, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_messagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); m_messagesBox = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
m_messagesBox->SetMaxLength( 0 );
m_messagesBox->SetMinSize( wxSize( -1,100 ) ); m_messagesBox->SetMinSize( wxSize( -1,100 ) );
bMainSizer->Add( m_messagesBox, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); bMainSizer->Add( m_messagesBox, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 10 2012) // C++ code generated with wxFormBuilder (version Oct 8 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
class DIALOG_SHIM;
#include "dialog_shim.h" #include "dialog_shim.h"
#include <wx/string.h> #include <wx/string.h>
#include <wx/stattext.h> #include <wx/stattext.h>
......
...@@ -170,8 +170,10 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit ...@@ -170,8 +170,10 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
if( GetCanvas()->IsMouseCaptured() ) if( GetCanvas()->IsMouseCaptured() )
GetCanvas()->CallMouseCapture( aDC, wxDefaultPosition, false ); GetCanvas()->CallMouseCapture( aDC, wxDefaultPosition, false );
GetBoard()->SetTrackWidthIndex( ( GetBoard()->GetTrackWidthIndex() + 1 ) % if( GetBoard()->GetTrackWidthIndex() < GetBoard()->m_TrackWidthList.size() - 1)
GetBoard()->m_TrackWidthList.size() ); GetBoard()->SetTrackWidthIndex( GetBoard()->GetTrackWidthIndex() + 1 );
else
GetBoard()->SetTrackWidthIndex( 0 );
if( GetCanvas()->IsMouseCaptured() ) if( GetCanvas()->IsMouseCaptured() )
GetCanvas()->CallMouseCapture( aDC, wxDefaultPosition, false ); GetCanvas()->CallMouseCapture( aDC, wxDefaultPosition, false );
...@@ -182,9 +184,9 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit ...@@ -182,9 +184,9 @@ void PCB_EDIT_FRAME::OnHotKey( wxDC* aDC, int aHotkeyCode, const wxPoint& aPosit
if( GetCanvas()->IsMouseCaptured() ) if( GetCanvas()->IsMouseCaptured() )
GetCanvas()->CallMouseCapture( aDC, wxDefaultPosition, false ); GetCanvas()->CallMouseCapture( aDC, wxDefaultPosition, false );
if( GetBoard()->GetTrackWidthIndex() == 0 ) if( GetBoard()->GetTrackWidthIndex() <= 0 )
GetBoard()->SetTrackWidthIndex( GetBoard()->m_TrackWidthList.size() ); GetBoard()->SetTrackWidthIndex( GetBoard()->m_TrackWidthList.size() -1 );
else
GetBoard()->SetTrackWidthIndex( GetBoard()->GetTrackWidthIndex() - 1 ); GetBoard()->SetTrackWidthIndex( GetBoard()->GetTrackWidthIndex() - 1 );
if( GetCanvas()->IsMouseCaptured() ) if( GetCanvas()->IsMouseCaptured() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment