Commit 6b8bc98d authored by charras's avatar charras
Browse files

fixed in libedit: import symbol not working.

parent 52631fc5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -528,7 +528,7 @@ void WinEDA_LibeditFrame::Process_Special_Functions( wxCommandEvent& event )

    case ID_LIBEDIT_IMPORT_BODY_BUTT:
        SetToolID( id, wxCURSOR_ARROW, _( "Import" ) );
        LoadOneSymbol( &dc );
        LoadOneSymbol( );
        SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
        break;

+20 −10
Original line number Diff line number Diff line
@@ -28,12 +28,13 @@ static bool CompareSymbols( LibEDA_BaseStruct* DEntryRef,
/* Variables locales */


/***************************************************/
void WinEDA_LibeditFrame::LoadOneSymbol( wxDC* DC )
/***************************************************/
/***********************************************/
void WinEDA_LibeditFrame::LoadOneSymbol( void )
/***********************************************/

/* Read a component shape file and add data (graphic items) to the current
/* Read a component shape file (a symbol file *.sym )and add data (graphic items) to the current
 *  component.
 * a symbol file *.sym has the same format as a library, and contains only one symbol
 */
{
    int                     NumOfParts;
@@ -44,11 +45,12 @@ void WinEDA_LibeditFrame::LoadOneSymbol( wxDC* DC )
    FILE*                   ImportFile;
    wxString                msg;

    if( CurrentDrawItem )
        return;
    if( CurrentLibEntry == NULL )
        return;

    if( CurrentDrawItem && CurrentDrawItem->m_Flags )   // a command is in progress
        return;

    DrawPanel->m_IgnoreMouseEvents = TRUE;

    mask = wxT( "*" ) + g_SymbolExtBuffer;
@@ -116,13 +118,21 @@ void WinEDA_LibeditFrame::LoadOneSymbol( wxDC* DC )
            DrawEntry = DrawEntry->Next();
        }

        // Remove duplicated drawings:
        SuppressDuplicateDrawItem( CurrentLibEntry );

        // crear flags
        DrawEntry = CurrentLibEntry->m_Drawings;
        while( DrawEntry )
        {
            DrawEntry->m_Flags    = 0;
            DrawEntry->m_Selected = 0;
            DrawEntry = DrawEntry->Next();
        }

        GetScreen()->SetModify();

        // Move (and place ) the new draw items:
        HandleBlockBegin( DC, -1, GetScreen()->m_Curseur );
        HandleBlockEnd( DC );
        RedrawActiveWindow( DC, TRUE );
        DrawPanel->Refresh();
    }

    PQFreeFunc( Entries, ( void( * ) ( void* ) )FreeLibraryEntry );
+1 −1
Original line number Diff line number Diff line
@@ -446,7 +446,7 @@ private:
    void                GraphicItemBeginDraw( wxDC* DC );
    void                StartMoveDrawSymbol( wxDC* DC );
    void                EndDrawGraphicItem( wxDC* DC );
    void                LoadOneSymbol( wxDC* DC );
    void                LoadOneSymbol( );
    void                SaveOneSymbol();
    void                EditGraphicSymbol( wxDC* DC, LibEDA_BaseStruct* DrawItem );
    void                EditSymbolText( wxDC* DC, LibEDA_BaseStruct* DrawItem );
+103 B (171 KiB)

File changed.

No diff preview for this file type.

+156 −953

File changed.

Preview size limit exceeded, changes collapsed.