Commit 37757b52 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

* Fix Bug #1348607 and a possible crash in libedit dialog component properties...

* Fix Bug #1348607 and a possible crash in libedit dialog component properties after moving up the first user field (which in not possible now).
* better info message in pcbnew when trying to delete a footprint in legacy library
parent 6cc3addc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -79,6 +79,8 @@ void PDF_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
    // The CTM is set to 1 user unit per decimil
    iuPerDeviceUnit = 1.0 / aIusPerDecimil;

    SetDefaultLineWidth( 100 / iuPerDeviceUnit );  // arbitrary default

    /* The paper size in this engined is handled page by page
       Look in the StartPage function */
}
@@ -511,7 +513,6 @@ void PDF_PLOTTER::StartPage()
    paperSize = pageInfo.GetSizeMils();
    paperSize.x *= 10.0 / iuPerDeviceUnit;
    paperSize.y *= 10.0 / iuPerDeviceUnit;
    SetDefaultLineWidth( 100 / iuPerDeviceUnit );  // arbitrary default

    // Open the content stream; the page object will go later
    pageStreamHandle = startPdfStream();
+6 −5
Original line number Diff line number Diff line
@@ -353,11 +353,10 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB:: moveUpButtonHandler( wxCommandEvent& e
    if( fieldNdx >= m_FieldsBuf.size() )    // traps the -1 case too
        return;

    if( fieldNdx < MANDATORY_FIELDS )
    {
        wxBell();
    // The first field which can be moved up is the second user field
    // so any field which id <= MANDATORY_FIELDS cannot be moved up
    if( fieldNdx <= MANDATORY_FIELDS )
        return;
    }

    if( !copyPanelToSelectedField() )
        return;
@@ -368,9 +367,11 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB:: moveUpButtonHandler( wxCommandEvent& e

    m_FieldsBuf[fieldNdx - 1] = m_FieldsBuf[fieldNdx];
    setRowItem( fieldNdx - 1, m_FieldsBuf[fieldNdx] );
    m_FieldsBuf[fieldNdx - 1].SetId(fieldNdx - 1);

    m_FieldsBuf[fieldNdx] = tmp;
    setRowItem( fieldNdx, tmp );
    m_FieldsBuf[fieldNdx].SetId(fieldNdx);

    updateDisplay( );

@@ -665,7 +666,7 @@ void DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB::copySelectedFieldToPanel()

    // only user defined fields may be moved, and not the top most user defined
    // field since it would be moving up into the fixed fields, > not >=
    moveUpButton->Enable( fieldNdx >= MANDATORY_FIELDS );
    moveUpButton->Enable( fieldNdx > MANDATORY_FIELDS );

    // if fieldNdx == REFERENCE, VALUE, then disable delete button
    deleteFieldButton->Enable( fieldNdx >= MANDATORY_FIELDS );
+1 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ static const wxString INFO_LEGACY_LIB_WARN_EDIT(
static const wxString INFO_LEGACY_LIB_WARN_DELETE(
        _(  "Modifying legacy libraries (.mod files) is not allowed\n"\
            "Please save the current library under the new .pretty format\n"\
            "and update your footprint lib table\n"\
            "before deleting a footprint" ) );

static const wxString ModLegacyExportFileWildcard( _( "Legacy foot print export files (*.emp)|*.emp" ) );