Don't assume a hypertext link is a cross-sheet reference.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20511
This commit is contained in:
Jeff Young 2025-03-30 21:54:52 +01:00
parent 2b0d082df5
commit 582aef0220

View File

@ -1012,11 +1012,14 @@ void SCH_FIELD::DoHypertextAction( EDA_DRAW_FRAME* aFrame ) const
constexpr int START_ID = 1;
if( IsHypertext() )
{
wxString href;
if( m_id == FIELD_T::INTERSHEET_REFS )
{
SCH_LABEL_BASE* label = static_cast<SCH_LABEL_BASE*>( m_parent );
SCH_SHEET_PATH* sheet = &label->Schematic()->CurrentSheet();
wxMenu menu;
wxString href;
std::vector<std::pair<wxString, wxString>> pages;
@ -1038,6 +1041,11 @@ void SCH_FIELD::DoHypertextAction( EDA_DRAW_FRAME* aFrame ) const
href = wxT( "#" ) + pages[ sel ].first;
else if( sel == 999 )
href = SCH_NAVIGATE_TOOL::g_BackLink;
}
else if( IsURL( GetShownText( false ) ) )
{
href = GetShownText( false );
}
if( !href.IsEmpty() )
{