eeschema, libedit: fixed a bug than crashes libedit when using the delete tool, on a left click.

This commit is contained in:
charras 2009-10-23 14:35:24 +00:00
parent 4b2f33a9d2
commit c03abc0b65
7 changed files with 20 additions and 44 deletions

View File

@ -539,6 +539,7 @@ EDA_Rect& EDA_Rect::Inflate( int aDelta )
*/
{
Inflate( aDelta, aDelta );
return *this;
}
/**************************************************/

View File

@ -229,20 +229,11 @@ void DIALOG_CVPCB_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
* because it preserve use of default libraries paths, when the path
* is a sub path of these default paths
*/
if( wxGetApp().GetLibraryPathList().Index( fn.GetPath() ) != wxNOT_FOUND ) // Ok, trivial case
libfilename = fn.GetName();
else // not in the default, : see if this file is in a subpath:
{
libfilename = fn.GetPathWithSep() + fn.GetName();
for( unsigned kk = 0; kk < wxGetApp().GetLibraryPathList().GetCount(); kk++ )
{
if( fn.MakeRelativeTo( wxGetApp().GetLibraryPathList()[kk] ) )
{
libfilename = fn.GetPathWithSep() + fn.GetName();
break;
}
}
}
libfilename = wxGetApp().ReturnFilenameWithRelativePathInLibPath( fn.GetFullPath() );
// Remove extension:
fn = libfilename;
fn.SetExt(wxEmptyString);
libfilename = fn.GetFullPath();
//Add or insert new library name, if not already in list
if( list->FindString( libfilename, fn.IsCaseSensitive() ) == wxNOT_FOUND )

View File

@ -1 +0,0 @@
#include "wx/msw/wx.rc"

View File

@ -1247,7 +1247,7 @@ void LIB_SEGMENT::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC,
* bounding box calculation. */
#if 0
EDA_Rect bBox = GetBoundingBox();
bBox.Inflate( m_Width + 2, m_Width + 2 );
bBox.Inflate( m_Width + 2 );
GRRect( &aPanel->m_ClipBox, aDC, bBox.GetOrigin().x, bBox.GetOrigin().y,
bBox.GetEnd().x, bBox.GetEnd().y, 0, LIGHTMAGENTA );
#endif

View File

@ -242,20 +242,11 @@ void DIALOG_EESCHEMA_CONFIG::OnAddOrInsertLibClick( wxCommandEvent& event )
* because it preserve use of default libraries paths, when the path
* is a sub path of these default paths
*/
if( wxGetApp().GetLibraryPathList().Index( fn.GetPath() ) != wxNOT_FOUND ) // Ok, trivial case
libfilename = fn.GetName();
else // not in the default, : see if this file is in a subpath:
{
libfilename = fn.GetPathWithSep() + fn.GetName();
for ( unsigned kk = 0; kk < wxGetApp().GetLibraryPathList().GetCount(); kk ++ )
{
if( fn.MakeRelativeTo(wxGetApp().GetLibraryPathList()[kk] ) )
{
libfilename = fn.GetPathWithSep() + fn.GetName();
break;
}
}
}
libfilename = wxGetApp().ReturnFilenameWithRelativePathInLibPath( fn.GetFullPath() );
// Remove extension:
fn = libfilename;
fn.SetExt(wxEmptyString);
libfilename = fn.GetFullPath();
//Add or insert new library name, if not already in list
if( m_ListLibr->FindString( libfilename, fn.IsCaseSensitive() ) == wxNOT_FOUND )

View File

@ -123,7 +123,10 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
GetScreen()->m_Curseur );
}
if( DrawEntry == NULL )
{
DisplayCmpDoc();
break;
}
SaveCopyInUndoList( m_component );
if( DrawEntry->Type() == COMPONENT_PIN_DRAW_TYPE )
DeletePin( DC, m_component, (LIB_PIN*) DrawEntry );

View File

@ -206,20 +206,11 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnAddOrInsertLibClick( wxCommandEvent& event )
* because it preserve use of default libraries paths, when the
* path is a sub path of these default paths
*/
if( wxGetApp().GetLibraryPathList().Index( fn.GetPath() ) != wxNOT_FOUND ) // Ok, trivial case
libfilename = fn.GetName();
else // not in the default, : see if this file is in a subpath:
{
libfilename = fn.GetPathWithSep() + fn.GetName();
for ( unsigned kk = 0; kk < wxGetApp().GetLibraryPathList().GetCount(); kk ++ )
{
if( fn.MakeRelativeTo(wxGetApp().GetLibraryPathList()[kk] ) )
{
libfilename = fn.GetPathWithSep() + fn.GetName();
break;
}
}
}
libfilename = wxGetApp().ReturnFilenameWithRelativePathInLibPath( fn.GetFullPath() );
// Remove extension:
fn = libfilename;
fn.SetExt(wxEmptyString);
libfilename = fn.GetFullPath();
//Add or insert new library name, if not already in list
if( m_ListLibr->FindString( libfilename, fn.IsCaseSensitive() ) == wxNOT_FOUND )