X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a5441ce3a5583735e9d52f029b2314cf5a46294c..accbb1e75890c115105210e9cb838909aa0e8114:/src/gtk1/utilsgtk.cpp diff --git a/src/gtk1/utilsgtk.cpp b/src/gtk1/utilsgtk.cpp index cef8dbe54e..e76e3187f3 100644 --- a/src/gtk1/utilsgtk.cpp +++ b/src/gtk1/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 // ----------------------------------------------------------------------------