Avoid C-style array member init (illegal in C++)
This is not part of the C++ language, and only supported in some compilers.
This commit is contained in:
parent
eaa31dc11b
commit
227afe77c0
|
@ -94,18 +94,20 @@ static const struct
|
||||||
{ "YELLOW4", 2 }
|
{ "YELLOW4", 2 }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Line types in the boilerplate DXF header. The
|
static const char* getDXFLineType( PlotDashType aType )
|
||||||
* element indices correspond to the eeschema line
|
|
||||||
* types.
|
|
||||||
*/
|
|
||||||
static const char *dxf_lines[] =
|
|
||||||
{
|
{
|
||||||
[ PLOTDASHTYPE_SOLID ] = "CONTINUOUS",
|
switch( aType )
|
||||||
[ PLOTDASHTYPE_DASH ] = "DASHED",
|
{
|
||||||
[ PLOTDASHTYPE_DOT ] = "DOTTED",
|
case PLOTDASHTYPE_SOLID: return "CONTINUOUS";
|
||||||
[ PLOTDASHTYPE_DASHDOT ] = "DASHDOT"
|
case PLOTDASHTYPE_DASH: return "DASHED";
|
||||||
};
|
case PLOTDASHTYPE_DOT: return "DOTTED";
|
||||||
|
case PLOTDASHTYPE_DASHDOT: return "DASHDOT";
|
||||||
|
}
|
||||||
|
|
||||||
|
wxFAIL_MSG( "Unhandled PlotDashType" );
|
||||||
|
return "CONTINUOUS";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// A helper function to create a color name acceptable in DXF files
|
// A helper function to create a color name acceptable in DXF files
|
||||||
|
@ -565,7 +567,7 @@ void DXF_PLOTTER::PenTo( const wxPoint& pos, char plume )
|
||||||
wxASSERT( m_currentLineType >= 0 && m_currentLineType < 4 );
|
wxASSERT( m_currentLineType >= 0 && m_currentLineType < 4 );
|
||||||
// DXF LINE
|
// DXF LINE
|
||||||
wxString cname = getDXFColorName( m_currentColor );
|
wxString cname = getDXFColorName( m_currentColor );
|
||||||
const char *lname = dxf_lines[ m_currentLineType ];
|
const char *lname = getDXFLineType( (PlotDashType) m_currentLineType );
|
||||||
fprintf( outputFile, "0\nLINE\n8\n%s\n6\n%s\n10\n%g\n20\n%g\n11\n%g\n21\n%g\n",
|
fprintf( outputFile, "0\nLINE\n8\n%s\n6\n%s\n10\n%g\n20\n%g\n11\n%g\n21\n%g\n",
|
||||||
TO_UTF8( cname ), lname,
|
TO_UTF8( cname ), lname,
|
||||||
pen_lastpos_dev.x, pen_lastpos_dev.y, pos_dev.x, pos_dev.y );
|
pen_lastpos_dev.x, pen_lastpos_dev.y, pos_dev.x, pos_dev.y );
|
||||||
|
|
|
@ -42,13 +42,20 @@
|
||||||
|
|
||||||
#include <dialogs/dialog_edit_line_style.h>
|
#include <dialogs/dialog_edit_line_style.h>
|
||||||
|
|
||||||
const enum wxPenStyle SCH_LINE::PenStyle[] =
|
|
||||||
|
static wxPenStyle getwxPenStyle( PlotDashType aType )
|
||||||
{
|
{
|
||||||
[PLOTDASHTYPE_SOLID] = wxPENSTYLE_SOLID,
|
switch( aType )
|
||||||
[PLOTDASHTYPE_DASH] = wxPENSTYLE_SHORT_DASH,
|
{
|
||||||
[PLOTDASHTYPE_DOT] = wxPENSTYLE_DOT,
|
case PLOTDASHTYPE_SOLID: return wxPENSTYLE_SOLID;
|
||||||
[PLOTDASHTYPE_DASHDOT] = wxPENSTYLE_DOT_DASH
|
case PLOTDASHTYPE_DASH: return wxPENSTYLE_SHORT_DASH;
|
||||||
};
|
case PLOTDASHTYPE_DOT: return wxPENSTYLE_DOT;
|
||||||
|
case PLOTDASHTYPE_DASHDOT: return wxPENSTYLE_DOT_DASH;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxFAIL_MSG( "Unhandled PlotDashType" );
|
||||||
|
return wxPENSTYLE_SOLID;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SCH_LINE::SCH_LINE( const wxPoint& pos, int layer ) :
|
SCH_LINE::SCH_LINE( const wxPoint& pos, int layer ) :
|
||||||
|
@ -321,7 +328,7 @@ void SCH_LINE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
|
||||||
end += offset;
|
end += offset;
|
||||||
|
|
||||||
GRLine( panel->GetClipBox(), DC, start.x, start.y, end.x, end.y, width, color,
|
GRLine( panel->GetClipBox(), DC, start.x, start.y, end.x, end.y, width, color,
|
||||||
PenStyle[ GetLineStyle() ] );
|
getwxPenStyle( (PlotDashType) GetLineStyle() ) );
|
||||||
|
|
||||||
if( m_startIsDangling )
|
if( m_startIsDangling )
|
||||||
DrawDanglingSymbol( panel, DC, start, color );
|
DrawDanglingSymbol( panel, DC, start, color );
|
||||||
|
|
|
@ -85,7 +85,6 @@ enum PlotDashType {
|
||||||
PLOTDASHTYPE_DASH,
|
PLOTDASHTYPE_DASH,
|
||||||
PLOTDASHTYPE_DOT,
|
PLOTDASHTYPE_DOT,
|
||||||
PLOTDASHTYPE_DASHDOT,
|
PLOTDASHTYPE_DASHDOT,
|
||||||
PLOTDASHTYPE_COUNT,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue