Browse Source

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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20511
revert-0c36e162
Jeff Young 9 months ago
parent
commit
582aef0220
  1. 10
      eeschema/sch_field.cpp

10
eeschema/sch_field.cpp

@ -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() )
{

Loading…
Cancel
Save