← Back to team overview

kicad-developers team mailing list archive

[PATCH] Fix duplicated pin in case of multipart symbol creation


Hi All,

Please find attached a patch to fix issue like this bug report:

Linked pin should be created (eeschema/pinedit.cpp:CreateImagePins) only
if the pin IS common to all unit.
So loop skip (continue instruction) should be called only if pin is NOT
common to all unit.

I know that schematic editor is currently undergoing major recontruction
but perhaps this quick fix could help some users...

From f415afdff0dc16c00a81478fcecfaff5bf7a2a75 Mon Sep 17 00:00:00 2001
From: Jean-Samuel Reynaud <js.reynaud@xxxxxxxxx>
Date: Tue, 5 Sep 2017 18:25:30 +0200
Subject: [PATCH] Fix duplicated pin in case of multipart symbol creation.
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------2.7.4"

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit

Should fix bug like: #1509936
 eeschema/pinedit.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Content-Type: text/x-patch; name="0001-Fix-duplicated-pin-in-case-of-multipart-symbol-creat.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Fix-duplicated-pin-in-case-of-multipart-symbol-creat.patch"

diff --git a/eeschema/pinedit.cpp b/eeschema/pinedit.cpp
index 1f40a39..6433b1b 100644
--- a/eeschema/pinedit.cpp
+++ b/eeschema/pinedit.cpp
@@ -511,7 +511,7 @@ void LIB_EDIT_FRAME::CreateImagePins( LIB_PIN* aPin, int aUnit, int aConvert, bo
     for( ii = 1; ii <= aPin->GetParent()->GetUnitCount(); ii++ )
-        if( ii == aUnit || aPin->GetUnit() == 0 )
+        if( ii == aUnit || aPin->GetUnit() != 0 )
             continue;                       // Pin common to all units.
         NewPin = (LIB_PIN*) aPin->Clone();


Follow ups