X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a5441ce3a5583735e9d52f029b2314cf5a46294c..23ad132ca3c6a24adab549e21d9cfc30ddc80e6d:/src/gtk/utilsgtk.cpp diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp index cef8dbe54e..e76e3187f3 100644 --- a/src/gtk/utilsgtk.cpp +++ b/src/gtk/utilsgtk.cpp @@ -81,6 +81,43 @@ bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) ) } #endif +#ifdef __WXGTK20__ +// Escapes string so that it is valid Pango markup XML string: +wxString wxEscapeStringForPangoMarkup(const wxString& str) +{ + size_t len = str.length(); + wxString out; + out.Alloc(len); + for (size_t i = 0; i < len; i++) + { + wxChar c = str[i]; + switch (c) + { + case _T('&'): + out << _T("&"); + break; + case _T('<'): + out << _T("<"); + break; + case _T('>'): + out << _T(">"); + break; + case _T('\''): + out << _T("'"); + break; + case _T('"'): + out << _T("""); + break; + default: + out << c; + break; + } + } + return out; +} +#endif + + // ---------------------------------------------------------------------------- // display characterstics // ----------------------------------------------------------------------------