BOARD_ITEM::GetBoard(), one size fits all. Maybe this can become non-virtual once tested.

This commit is contained in:
dickelbeck 2009-08-17 16:56:02 +00:00
parent d21ced6288
commit 1873e058dc
1 changed files with 8 additions and 2 deletions

View File

@ -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;
}