From 0f2beed54a3c87cde00db323ca94c0a4894ef1f9 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 30 Oct 2023 11:27:08 +0100 Subject: [PATCH] LIB_TREE: use GetAssociatedDocument() to display the doc from a wxHtmlLinkEvent One cannot always use the string given in the wxHtmlLinkEvent without expanding Env Vars. Fixes #15984 https://gitlab.com/kicad/code/kicad/-/issues/15984 --- common/widgets/lib_tree.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/widgets/lib_tree.cpp b/common/widgets/lib_tree.cpp index f1ae9736df..cf3251882f 100644 --- a/common/widgets/lib_tree.cpp +++ b/common/widgets/lib_tree.cpp @@ -37,7 +37,10 @@ #include #include #include -#include "wx/app.h" + +#include // for GetAssociatedDocument() +#include // for PROJECT +#include // for PROJECT constexpr int RECENT_SEARCHES_MAX = 10; @@ -808,7 +811,10 @@ void LIB_TREE::onTreeActivate( wxDataViewEvent& aEvent ) void LIB_TREE::onDetailsLink( wxHtmlLinkEvent& aEvent ) { const wxHtmlLinkInfo& info = aEvent.GetLinkInfo(); - ::wxLaunchDefaultBrowser( info.GetHref() ); + wxString docname = info.GetHref(); + PROJECT& prj = Pgm().GetSettingsManager().Prj(); + + GetAssociatedDocument( this, docname, &prj ); }