diff --git a/eeschema/dialogs/dialog_lib_edit_pin.h b/eeschema/dialogs/dialog_lib_edit_pin.h index ba4063ebe4..dab9d9022e 100644 --- a/eeschema/dialogs/dialog_lib_edit_pin.h +++ b/eeschema/dialogs/dialog_lib_edit_pin.h @@ -68,11 +68,11 @@ public: ELECTRICAL_PINTYPE GetElectricalType( void ) { - return m_choiceElectricalType->GetSelection(); + return m_choiceElectricalType->GetPinTypeSelection(); } void SetStyle( GRAPHIC_PINSHAPE style ) { m_choiceStyle->SetSelection( style ); } - GRAPHIC_PINSHAPE GetStyle( void ) { return m_choiceStyle->GetSelection(); } + GRAPHIC_PINSHAPE GetStyle( void ) { return m_choiceStyle->GetPinShapeSelection(); } void SetPinName( const wxString& name ) { m_textPinName->SetValue( name ); } wxString GetPinName( void ) { return m_textPinName->GetValue(); } diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index 96fff9fea5..b91101074c 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2015 Wayne Stambaugh - * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -72,7 +72,8 @@ static const BITMAP_DEF iconsPinsOrientations[] = const wxString LIB_PIN::GetCanonicalElectricalTypeName( ELECTRICAL_PINTYPE aType ) { - assert( aType >= 0 && aType < (int) PINTYPE_COUNT ); + if( aType < 0 || aType >= (int) PINTYPE_COUNT ); + return wxT( "???" ); // These strings are the canonical name of the electrictal type // Not translated, no space in name, only ASCII chars. @@ -93,9 +94,6 @@ const wxString LIB_PIN::GetCanonicalElectricalTypeName( ELECTRICAL_PINTYPE aType wxT( "NotConnected" ) }; - if( aType > (int) PINTYPE_COUNT ) - return wxT( "???" ); - return msgPinElectricType[ aType ]; } diff --git a/eeschema/widgets/pin_shape_combobox.cpp b/eeschema/widgets/pin_shape_combobox.cpp index 9bab9ff8c5..a2c43c916c 100644 --- a/eeschema/widgets/pin_shape_combobox.cpp +++ b/eeschema/widgets/pin_shape_combobox.cpp @@ -57,9 +57,9 @@ PinShapeComboBox::PinShapeComboBox( wxWindow* parent, } -GRAPHIC_PINSHAPE PinShapeComboBox::GetSelection() +GRAPHIC_PINSHAPE PinShapeComboBox::GetPinShapeSelection() { - return static_cast( wxBitmapComboBox::GetSelection() ); + return static_cast( GetSelection() ); } diff --git a/eeschema/widgets/pin_shape_combobox.h b/eeschema/widgets/pin_shape_combobox.h index 659aa020b7..b1f0bddd03 100644 --- a/eeschema/widgets/pin_shape_combobox.h +++ b/eeschema/widgets/pin_shape_combobox.h @@ -46,6 +46,6 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxBitmapComboBoxNameStr ); - GRAPHIC_PINSHAPE GetSelection(); - void SetSelection( GRAPHIC_PINSHAPE aShape ); + GRAPHIC_PINSHAPE GetPinShapeSelection(); + void SetSelection( GRAPHIC_PINSHAPE aShape ); }; diff --git a/eeschema/widgets/pin_type_combobox.cpp b/eeschema/widgets/pin_type_combobox.cpp index 70dd5bd1b0..e587c41fae 100644 --- a/eeschema/widgets/pin_type_combobox.cpp +++ b/eeschema/widgets/pin_type_combobox.cpp @@ -57,9 +57,9 @@ PinTypeComboBox::PinTypeComboBox( wxWindow* parent, } -ELECTRICAL_PINTYPE PinTypeComboBox::GetSelection() +ELECTRICAL_PINTYPE PinTypeComboBox::GetPinTypeSelection() { - return static_cast( wxBitmapComboBox::GetSelection() ); + return static_cast( GetSelection() ); } diff --git a/eeschema/widgets/pin_type_combobox.h b/eeschema/widgets/pin_type_combobox.h index c94c5d67dc..00036e1961 100644 --- a/eeschema/widgets/pin_type_combobox.h +++ b/eeschema/widgets/pin_type_combobox.h @@ -46,6 +46,6 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxBitmapComboBoxNameStr ); - ELECTRICAL_PINTYPE GetSelection(); + ELECTRICAL_PINTYPE GetPinTypeSelection(); void SetSelection( ELECTRICAL_PINTYPE aType ); };