eeschema: fix Bug #1385789 (eeschema segfaults, when editing a new field). Fix an other minor bug in Footprint editor.

This commit is contained in:
jean-pierre charras 2014-10-26 12:42:25 +01:00
parent 5034f07a31
commit fa96780798
4 changed files with 9 additions and 6 deletions

View File

@ -86,8 +86,8 @@ LIB_ALIAS::~LIB_ALIAS()
wxASSERT_MSG( shared, wxT( "~LIB_ALIAS() without a LIB_PART" ) );
#if defined(DEBUG) && 1
printf( "%s: destroying alias:'%s' of part:'%s' alias count:%zd.\n",
__func__, TO_UTF8( name ), TO_UTF8( shared->GetName() ), shared->m_aliases.size() );
printf( "%s: destroying alias:'%s' of part:'%s' alias count:%d.\n",
__func__, TO_UTF8( name ), TO_UTF8( shared->GetName() ), int( shared->m_aliases.size() ) );
#endif
if( shared )
@ -249,8 +249,8 @@ LIB_PART::~LIB_PART()
(void) breakhere;
}
printf( "%s: destroying part '%s' with alias list count of %zd\n",
__func__, TO_UTF8( GetName() ), m_aliases.size() );
printf( "%s: destroying part '%s' with alias list count of %d\n",
__func__, TO_UTF8( GetName() ), int( m_aliases.size() ) );
#endif
// If the part is being deleted directly rather than through the library,
@ -1112,6 +1112,7 @@ void LIB_PART::SetFields( const std::vector <LIB_FIELD>& aFields )
// drawings is a ptr_vector, new and copy an object on the heap.
LIB_FIELD* field = new LIB_FIELD( aFields[i] );
field->SetParent( this );
drawings.push_back( field );
}

View File

@ -136,7 +136,7 @@ private:
void LIB_EDIT_FRAME::InstallFieldsEditorDialog( wxCommandEvent& event )
{
if( !GetCurLib() )
if( !GetCurPart() )
return;
m_canvas->EndMouseCapture( ID_NO_TOOL_SELECTED, m_canvas->GetDefaultCursor() );

View File

@ -48,6 +48,8 @@ void LIB_EDIT_FRAME::EditField( LIB_FIELD* aField )
LIB_PART* parent = aField->GetParent();
wxASSERT( parent );
// Editing the component value field is equivalent to creating a new component based
// on the current component. Set the dialog message to inform the user.
if( aField->GetId() == VALUE )

View File

@ -267,7 +267,7 @@ void KICAD_MANAGER_FRAME::ReCreateMenuBar()
// Contents
AddMenuItem( helpMenu, wxID_HELP,
_( "KiCad Manual" ),
_( "KiCad &Manual" ),
_( "Open KiCad user manual" ),
KiBitmap( online_help_xpm ) );