Commit 1873e058 authored by dickelbeck's avatar dickelbeck
Browse files

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

parent d21ced62
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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;
}