Prevent duplicate objects during block copy in symbol library editor.
Fixes lp:1714109 https://bugs.launchpad.net/kicad/+bug/1714109
This commit is contained in:
parent
450f006d7d
commit
1c617b9f56
|
@ -1491,6 +1491,7 @@ void LIB_PART::CopySelectedItems( const wxPoint& aOffset )
|
|||
* a memory reallocation can happen and will break pointers
|
||||
*/
|
||||
unsigned icnt = drawings.size();
|
||||
std::vector< LIB_ITEM* > tmp;
|
||||
|
||||
for( unsigned ii = 0; ii < icnt; ii++ )
|
||||
{
|
||||
|
@ -1507,9 +1508,12 @@ void LIB_PART::CopySelectedItems( const wxPoint& aOffset )
|
|||
item.ClearFlags( SELECTED );
|
||||
LIB_ITEM* newItem = (LIB_ITEM*) item.Clone();
|
||||
newItem->SetFlags( SELECTED );
|
||||
drawings.push_back( newItem );
|
||||
tmp.push_back( newItem );
|
||||
}
|
||||
|
||||
for( unsigned ii = 0; ii < tmp.size(); ii++ )
|
||||
drawings.push_back( tmp[ii] );
|
||||
|
||||
MoveSelectedItems( aOffset );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue