From d46d46ed1fad415370e840dea2bb34d9b7483411 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 25 Jul 2014 19:49:14 +0200 Subject: [PATCH] * 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 --- common/common_plotPDF_functions.cpp | 3 ++- .../dialogs/dialog_edit_libentry_fields_in_lib.cpp | 11 ++++++----- pcbnew/librairi.cpp | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/common/common_plotPDF_functions.cpp b/common/common_plotPDF_functions.cpp index 7de4a6bd6a..09821b902e 100644 --- a/common/common_plotPDF_functions.cpp +++ b/common/common_plotPDF_functions.cpp @@ -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(); diff --git a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp index 4378cc00c9..67d891b23f 100644 --- a/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp +++ b/eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp @@ -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 ); diff --git a/pcbnew/librairi.cpp b/pcbnew/librairi.cpp index 9174f7dcbe..e28b6c84bd 100644 --- a/pcbnew/librairi.cpp +++ b/pcbnew/librairi.cpp @@ -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" ) );