Duplicate block in eeschema adds extra components

Bug #1714109 reported by Seth Hillbrand on 2017-08-30
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Undecided
Unassigned

Bug Description

Application: kicad
Version: (2017-08-30 revision 3ac87f696)-master, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.52.1 GnuTLS/3.5.8 zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
Platform: Linux 4.9.0-3-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.62.0
    Curl: 7.52.1
    KiCad compiler: GCC 6.3.0 with C++ ABI 1010
Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON

When editing a library part in eeschema (probably elsewhere in eeschema as well), using the "block duplicate" function results in many extra components being added.

This is a result of the new libentry routines inserting the duplicated parts into the map (sorted by type) but then iterating by index. Thus the newly inserted part that is now selected gets duplicated and inserted again if it is not a member of the last type in the map.

I'm attaching a proposed patch to fix this behavior. The patch creates a temporary vector to store the newly duplicated items until we finish duplicating all selected items. The temporary vector is then pushed into the map, updating the LIB_ITEMS_LIST.

Seth Hillbrand (sethh) wrote :
Wayne Stambaugh (stambaughw) wrote :

@Seth, good catch! I committed your patch to the master branch. Thank you for your contribution to KiCad. For future reference, the preferred method for patch submission is to commit your changes to your local git repo and use `git format-patch` to create the patch. This way busy lead developers do not have to enter your author information and create a commit message.

Seth Hillbrand (sethh) wrote :

@Wayne, got it. Will apply that method in the future. Thanks for the quick review!

Nicholas Savenlid (nicholas-z) wrote :

is this committed into nightlies ?

It was committed 11 days ago:

On 9/12/2017 10:05 AM, Nicholas Savenlid wrote:
> is this committed into nightlies ?
>

Wayne Stambaugh (stambaughw) wrote :

https://git.launchpad.net/kicad/commit/?id=1c617b9f56e7361f11d04ba01a5777b65ca5ad92

Perhaps the build server is down for your platform.

On 9/12/2017 10:05 AM, Nicholas Savenlid wrote:
> is this committed into nightlies ?
>

Nicholas Savenlid (nicholas-z) wrote :

the status of this bug != committed

that is why I asked.

I assumed ( and i may be completely wrong ) that bugs was/are/where marked committed once committed.

my platform is windows, but i use a nightly from 2017-08-27 so i missed this commit by 4 days.

will fetch a new one.

Thanks

Wayne Stambaugh (stambaughw) wrote :

I forgot the KiCad janitor was down. This should have been
automatically tagged as fix committed when I pushed the patch to the
master branch. I updated the status.

On 9/12/2017 11:33 AM, Nicholas Savenlid wrote:
> the status of this bug != committed
>
> that is why I asked.
>
> I assumed ( and i may be completely wrong ) that bugs was/are/where
> marked committed once committed.
>
> my platform is windows, but i use a nightly from 2017-08-27 so i missed
> this commit by 4 days.
>
> will fetch a new one.
>
> Thanks
>

Changed in kicad:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers