eeschema: Handle broken spin style value
The spin style is stored as a numeric and can be corrupted. We handle this by triggering assertions for debugging the bad value while resetting to default if we have non-valid spin values that are outside the array. Fixes: lp:1843091 * https://bugs.launchpad.net/kicad/+bug/1843091
This commit is contained in:
parent
37b3c698c8
commit
c3226653cc
|
@ -44,6 +44,8 @@
|
|||
#include <netlist_object.h>
|
||||
#include <trace_helpers.h>
|
||||
|
||||
#include <wx/debug.h>
|
||||
|
||||
|
||||
extern void IncrementLabelMember( wxString& name, int aIncrement );
|
||||
|
||||
|
@ -236,7 +238,10 @@ void SCH_TEXT::SetLabelSpinStyle( int aSpinStyle )
|
|||
switch( aSpinStyle )
|
||||
{
|
||||
default:
|
||||
case 0: // Horiz Normal Orientation (left justified)
|
||||
wxASSERT_MSG( 1, "Bad spin style" );
|
||||
case 0: // Horiz Normal Orientation
|
||||
//
|
||||
m_spin_style = 0; // Handle the error spin style by resetting
|
||||
SetTextAngle( TEXT_ANGLE_HORIZ );
|
||||
SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT );
|
||||
SetVertJustify( GR_TEXT_VJUSTIFY_BOTTOM );
|
||||
|
@ -784,7 +789,10 @@ void SCH_GLOBALLABEL::SetLabelSpinStyle( int aSpinStyle )
|
|||
switch( aSpinStyle )
|
||||
{
|
||||
default:
|
||||
wxASSERT_MSG( 1, "Bad spin style" );
|
||||
case 0: // Horiz Normal Orientation
|
||||
//
|
||||
m_spin_style = 0; // Handle the error spin style by resetting
|
||||
SetTextAngle( TEXT_ANGLE_HORIZ );
|
||||
SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT );
|
||||
SetVertJustify( GR_TEXT_VJUSTIFY_CENTER );
|
||||
|
@ -1015,7 +1023,10 @@ void SCH_HIERLABEL::SetLabelSpinStyle( int aSpinStyle )
|
|||
switch( aSpinStyle )
|
||||
{
|
||||
default:
|
||||
wxASSERT_MSG( 1, "Bad spin style" );
|
||||
case 0: // Horiz Normal Orientation
|
||||
//
|
||||
m_spin_style = 0; // Handle the error spin style by resetting
|
||||
SetTextAngle( TEXT_ANGLE_HORIZ );
|
||||
SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT );
|
||||
SetVertJustify( GR_TEXT_VJUSTIFY_CENTER );
|
||||
|
|
Loading…
Reference in New Issue