From f27d4060df621a805597dd06998e71939d263734 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 27 Feb 2011 12:47:11 +0000 Subject: [PATCH] Remove unnecessary use of RemoveMarkup() in wxMSW wxHyperlinkCtrl. 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 --- src/msw/hyperlink.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/msw/hyperlink.cpp b/src/msw/hyperlink.cpp index de729770fd..cb8951c936 100644 --- a/src/msw/hyperlink.cpp +++ b/src/msw/hyperlink.cpp @@ -25,7 +25,6 @@ #ifndef WX_PRECOMP #include "wx/app.h" - #include "wx/stattext.h" #include "wx/msw/wrapcctl.h" // include "properly" #include "wx/msw/private.h" #include "wx/msw/missing.h" @@ -63,8 +62,11 @@ namespace wxString GetLabelForSysLink(const wxString& text, const wxString& url) { - return wxString("" - + wxStaticText::RemoveMarkup(text) + ""; + // Any "&"s in the text should appear on the screen and not be (mis) + // interpreted as mnemonics. + return wxString::Format("%s", + url, + wxControl::EscapeMnemonics(text)); } } -- 2.45.2