Handle all member vars if not doing a std::swap on "this".

Fixes https://gitlab.com/kicad/code/kicad/issues/13621
This commit is contained in:
Jeff Young 2023-01-22 12:52:41 +00:00
parent 9c12a6ee1d
commit 03a64492e8
2 changed files with 10 additions and 1 deletions

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2011 jean-pierre.charras
* Copyright (C) 2022 Mike Williams
* Copyright (C) 2011-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2011-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -107,6 +107,13 @@ void PCB_BITMAP::swapData( BOARD_ITEM* aItem )
aItem->GetClass() ) );
PCB_BITMAP* item = (PCB_BITMAP*) aItem;
std::swap( m_layer, item->m_layer );
std::swap( m_isKnockout, item->m_isKnockout );
std::swap( m_isLocked, item->m_isLocked );
std::swap( m_flags, item->m_flags );
std::swap( m_status, item->m_status );
std::swap( m_parent, item->m_parent );
std::swap( m_forceVisible, item->m_forceVisible );
std::swap( m_pos, item->m_pos );
std::swap( m_image, item->m_image );
}

View File

@ -356,6 +356,8 @@ void PCB_SHAPE::swapData( BOARD_ITEM* aImage )
// Swap params not handled by SwapShape( image )
std::swap( m_layer, image->m_layer );
std::swap( m_isKnockout, image->m_isKnockout );
std::swap( m_isLocked, image->m_isLocked );
std::swap( m_flags, image->m_flags );
std::swap( m_status, image->m_status );
std::swap( m_parent, image->m_parent );