BOARD_ITEM::GetBoard(), one size fits all. Maybe this can become non-virtual once tested.
This commit is contained in:
parent
d21ced6288
commit
1873e058dc
|
@ -318,8 +318,14 @@ void BOARD_ITEM::UnLink()
|
|||
|
||||
BOARD* BOARD_ITEM::GetBoard() const
|
||||
{
|
||||
// overload this function as needed.
|
||||
if( Type() == TYPE_PCB )
|
||||
return (BOARD*) this;
|
||||
|
||||
return (BOARD*) GetParent();
|
||||
BOARD_ITEM* parent = GetParent();
|
||||
|
||||
if( parent )
|
||||
return parent->GetBoard();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue