mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
sch groups: add swap data fix
Copied from 199a7a34ead5998cdd7269338312f34bc4022703 for board items
This commit is contained in:
parent
9cb0d100e5
commit
f51c5c396f
@ -250,8 +250,23 @@ SCH_GROUP* SCH_GROUP::DeepDuplicate() const
|
|||||||
void SCH_GROUP::swapData( SCH_ITEM* aImage )
|
void SCH_GROUP::swapData( SCH_ITEM* aImage )
|
||||||
{
|
{
|
||||||
assert( aImage->Type() == SCH_GROUP_T );
|
assert( aImage->Type() == SCH_GROUP_T );
|
||||||
|
SCH_GROUP* image = static_cast<SCH_GROUP*>( aImage );
|
||||||
|
|
||||||
std::swap( *( (SCH_GROUP*) this ), *( (SCH_GROUP*) aImage ) );
|
std::swap( *( (SCH_GROUP*) this ), *( (SCH_GROUP*) aImage ) );
|
||||||
|
|
||||||
|
RunOnChildren(
|
||||||
|
[&]( SCH_ITEM* child )
|
||||||
|
{
|
||||||
|
child->SetParentGroup( this );
|
||||||
|
},
|
||||||
|
RECURSE_MODE::NO_RECURSE );
|
||||||
|
|
||||||
|
image->RunOnChildren(
|
||||||
|
[&]( SCH_ITEM* child )
|
||||||
|
{
|
||||||
|
child->SetParentGroup( image );
|
||||||
|
},
|
||||||
|
RECURSE_MODE::NO_RECURSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user