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 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 ) ) // Don't report parent footprint info from footprint editor, viewer, etc.
{ if( GetBoard() && GetBoard()->GetBoardUse() == BOARD_USE::FPHOLDER )
if( frame->GetName() == PCB_EDIT_FRAME_NAME ) parentFP = nullptr;
parentFP = GetParentFootprint();
}
if( GetAttribute() == PAD_ATTRIB::NPTH ) 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 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 ) ) // Don't report parent footprint info from footprint editor, viewer, etc.
{ if( GetBoard() && GetBoard()->GetBoardUse() == BOARD_USE::FPHOLDER )
if( frame->GetName() == PCB_EDIT_FRAME_NAME ) parentFP = nullptr;
parentFP = GetParentFootprint();
}
if( IsOnCopperLayer() ) if( IsOnCopperLayer() )
{ {