7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 00:21:25 +00:00

Better way of determining if we're reporting from the footprint editor.

This commit is contained in:
Jeff Young 2025-02-17 16:17:34 +00:00
parent 006d8b290a
commit c136df247f
2 changed files with 8 additions and 12 deletions

View File

@ -1539,13 +1539,11 @@ wxString PAD::ShowPadAttr() const
wxString PAD::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
FOOTPRINT* parentFP = nullptr;
FOOTPRINT* parentFP = GetParentFootprint();
if( EDA_DRAW_FRAME* frame = dynamic_cast<EDA_DRAW_FRAME*>( aUnitsProvider ) )
{
if( frame->GetName() == PCB_EDIT_FRAME_NAME )
parentFP = GetParentFootprint();
}
// Don't report parent footprint info from footprint editor, viewer, etc.
if( GetBoard() && GetBoard()->GetBoardUse() == BOARD_USE::FPHOLDER )
parentFP = nullptr;
if( GetAttribute() == PAD_ATTRIB::NPTH )
{

View File

@ -649,13 +649,11 @@ void PCB_SHAPE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_I
wxString PCB_SHAPE::GetItemDescription( UNITS_PROVIDER* aUnitsProvider, bool aFull ) const
{
FOOTPRINT* parentFP = nullptr;
FOOTPRINT* parentFP = GetParentFootprint();
if( EDA_DRAW_FRAME* frame = dynamic_cast<EDA_DRAW_FRAME*>( aUnitsProvider ) )
{
if( frame->GetName() == PCB_EDIT_FRAME_NAME )
parentFP = GetParentFootprint();
}
// Don't report parent footprint info from footprint editor, viewer, etc.
if( GetBoard() && GetBoard()->GetBoardUse() == BOARD_USE::FPHOLDER )
parentFP = nullptr;
if( IsOnCopperLayer() )
{