Only the ampersands need to be escaped when setting the text of a native hyper
link control in MSW and this is done by wxControl::EscapeMnemonics(), not by
wxStaticText::RemoveMarkup() which also removes any tags which is not wanted
at all here.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67053
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#ifndef WX_PRECOMP
#include "wx/app.h"
#ifndef WX_PRECOMP
#include "wx/app.h"
- #include "wx/stattext.h"
#include "wx/msw/wrapcctl.h" // include <commctrl.h> "properly"
#include "wx/msw/private.h"
#include "wx/msw/missing.h"
#include "wx/msw/wrapcctl.h" // include <commctrl.h> "properly"
#include "wx/msw/private.h"
#include "wx/msw/missing.h"
wxString GetLabelForSysLink(const wxString& text, const wxString& url)
{
wxString GetLabelForSysLink(const wxString& text, const wxString& url)
{
- return wxString("<A HREF=\"") + wxStaticText::RemoveMarkup(url) + "\">"
- + wxStaticText::RemoveMarkup(text) + "</A>";
+ // Any "&"s in the text should appear on the screen and not be (mis)
+ // interpreted as mnemonics.
+ return wxString::Format("<A HREF=\"%s\">%s</A>",
+ url,
+ wxControl::EscapeMnemonics(text));