Browse Source

Eeschema: void CollectOtherUnits(): do not try to collect others units

of a not annotated component.

Fixes #4142
https://gitlab.com/kicad/code/kicad/issues/4142
pull/16/head
jean-pierre charras 6 years ago
parent
commit
029b1b0b22
  1. 3
      eeschema/dialogs/dialog_edit_one_field.cpp
  2. 2954
      eeschema/dialogs/dialog_lib_edit_text_base.fbp
  3. 3
      eeschema/ee_collectors.cpp

3
eeschema/dialogs/dialog_edit_one_field.cpp

@ -273,10 +273,11 @@ void DIALOG_SCH_EDIT_ONE_FIELD::UpdateField( SCH_FIELD* aField, SCH_SHEET_PATH*
// The value, footprint and datasheet fields should be kept in sync in multi-unit
// parts.
// Of course the component must be annotated to collect other units.
if( editFrame && parent && parent->Type() == SCH_COMPONENT_T
&& ( fieldType == VALUE || fieldType == FOOTPRINT || fieldType == DATASHEET ) )
{
SCH_COMPONENT* thisUnit = static_cast<SCH_COMPONENT*>( parent );
SCH_COMPONENT* thisUnit = static_cast<SCH_COMPONENT*>( parent );
std::vector<SCH_COMPONENT*> otherUnits;
CollectOtherUnits( editFrame->GetCurrentSheet(), thisUnit, &otherUnits );

2954
eeschema/dialogs/dialog_lib_edit_text_base.fbp
File diff suppressed because it is too large
View File

3
eeschema/ee_collectors.cpp

@ -171,7 +171,8 @@ bool EE_COLLECTOR::IsDraggableJunction() const
void CollectOtherUnits( SCH_SHEET_PATH& aSheet, SCH_COMPONENT* aUnit,
std::vector<SCH_COMPONENT*>* otherUnits )
{
if( aUnit->GetUnitCount() > 1 )
// Obviously, one can collect other units only if aUnit is annotated.
if( aUnit->GetUnitCount() > 1 && aUnit->IsAnnotated( &aSheet ) )
{
const LIB_ID thisLibId = aUnit->GetLibId();
const wxString thisRef = aUnit->GetRef( &aSheet );

Loading…
Cancel
Save