Fix a few compil and Coverity warnings.
This commit is contained in:
@@ -492,6 +492,7 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE
|
||||
return _( "cu. in" );
|
||||
}
|
||||
}
|
||||
break; // Make compil happy.
|
||||
|
||||
case EDA_UNITS::MILLIMETRES:
|
||||
switch( aType )
|
||||
@@ -503,6 +504,7 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE
|
||||
case EDA_DATA_TYPE::VOLUME:
|
||||
return _( "cu. mm" );
|
||||
}
|
||||
break; // Make compil happy.
|
||||
|
||||
case EDA_UNITS::PERCENT:
|
||||
return _( "%" );
|
||||
@@ -514,8 +516,10 @@ wxString GetAbbreviatedUnitsLabel( EDA_UNITS aUnit, bool aUseMils, EDA_DATA_TYPE
|
||||
return _( "deg" );
|
||||
|
||||
default:
|
||||
return wxT( "??" );
|
||||
break;
|
||||
}
|
||||
|
||||
return wxT( "??" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@ EDA_TEXT::EDA_TEXT( const wxString& text ) :
|
||||
{
|
||||
int sz = Mils2iu( DEFAULT_SIZE_TEXT );
|
||||
SetTextSize( wxSize( sz, sz ) );
|
||||
m_shown_text_has_text_var_refs = false;
|
||||
|
||||
if( !text.IsEmpty() )
|
||||
{
|
||||
|
||||
@@ -568,7 +568,7 @@ const wxPoint SCH_FIELD::GetPosition() const
|
||||
|
||||
wxPoint SCH_FIELD::GetParentPosition() const
|
||||
{
|
||||
return m_Parent->GetPosition();
|
||||
return m_Parent ? m_Parent->GetPosition() : wxPoint( 0, 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ void PCB_DRAW_PANEL_GAL::UpdateColors()
|
||||
else
|
||||
cs = Pgm().GetSettingsManager().GetColorSettings();
|
||||
|
||||
wxASSERT( cs );
|
||||
wxCHECK_RET( cs, "null COLOR_SETTINGS" );
|
||||
|
||||
if( frame && frame->IsType( FRAME_FOOTPRINT_EDITOR ) )
|
||||
cs->SetColorContext( COLOR_CONTEXT::FOOTPRINT );
|
||||
|
||||
Reference in New Issue
Block a user