Fixes: lp:1694456
https://bugs.launchpad.net/kicad/+bug/1694456 EEschema load: report "unit value out of range" in sub-sheet, although it is not the case.
This commit is contained in:
parent
e6baaa6164
commit
c0bb8a30c2
|
@ -35,7 +35,7 @@
|
|||
#include <general.h>
|
||||
#include <libeditframe.h>
|
||||
#include <class_library.h>
|
||||
#include <eeschema_id.h> // for ID_POPUP_SCH_SELECT_UNIT_CMP_MAX and ID_POPUP_SCH_SELECT_UNIT1
|
||||
#include <eeschema_id.h> // for MAX_UNIT_COUNT_PER_PACKAGE definition
|
||||
|
||||
#include <dialog_edit_component_in_lib.h>
|
||||
|
||||
|
@ -158,7 +158,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::InitBasicPanel()
|
|||
if( m_Parent->GetShowDeMorgan() )
|
||||
m_AsConvertButt->SetValue( true );
|
||||
|
||||
int maxUnits = ID_POPUP_SCH_SELECT_UNIT_CMP_MAX - ID_POPUP_SCH_SELECT_UNIT1;
|
||||
int maxUnits = MAX_UNIT_COUNT_PER_PACKAGE;
|
||||
m_SelNumberOfUnits->SetRange (1, maxUnits );
|
||||
|
||||
m_staticTextNbUnits->SetLabel( wxString::Format(
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
#include <lib_polyline.h>
|
||||
#include <lib_rectangle.h>
|
||||
#include <lib_text.h>
|
||||
#include <eeschema_id.h> // for MAX_UNIT_COUNT_PER_PACKAGE definition
|
||||
|
||||
|
||||
// Must be the first line of part library document (.dcm) files.
|
||||
|
@ -1397,7 +1398,7 @@ SCH_COMPONENT* SCH_LEGACY_PLUGIN::loadComponent( FILE_LINE_READER& aReader )
|
|||
if( !unit.ToLong( &tmp, 10 ) )
|
||||
SCH_PARSE_ERROR( "expected integer value", aReader, line );
|
||||
|
||||
if( tmp < 0 || tmp > 26 )
|
||||
if( tmp < 0 || tmp > MAX_UNIT_COUNT_PER_PACKAGE )
|
||||
SCH_PARSE_ERROR( "unit value out of range", aReader, line );
|
||||
|
||||
component->AddHierarchicalReference( path, reference, (int)tmp );
|
||||
|
|
Loading…
Reference in New Issue