From: John Spray Date: Tue, 6 Jun 2006 16:49:23 +0000 (+0000) Subject: escape special characters in strings passed to gtk as markup X-Git-Tag: 1.6.10~13147 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=87ce9b764791315b4be7cf9ccd2ea4c95cc94cfc;p=lyx.git escape special characters in strings passed to gtk as markup git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14022 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/gtk/Alert_pimpl.C b/src/frontends/gtk/Alert_pimpl.C index 3233be9c9b..ac6a19c4d4 100644 --- a/src/frontends/gtk/Alert_pimpl.C +++ b/src/frontends/gtk/Alert_pimpl.C @@ -45,7 +45,7 @@ string translateShortcut(string const & str) void warning_pimpl(string const & title, string const & message) { - Gtk::MessageDialog dlg(Glib::locale_to_utf8(message), + Gtk::MessageDialog dlg(Glib::Markup::escape_text(Glib::locale_to_utf8(message)), true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_CLOSE, true); dlg.set_title(title); @@ -55,7 +55,7 @@ void warning_pimpl(string const & title, string const & message) void error_pimpl(string const & title, string const & message) { - Gtk::MessageDialog dlg(Glib::locale_to_utf8(message), + Gtk::MessageDialog dlg(Glib::Markup::escape_text(Glib::locale_to_utf8(message)), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true); dlg.set_title(title); @@ -65,7 +65,7 @@ void error_pimpl(string const & title, string const & message) void information_pimpl(string const & title, string const & message) { - Gtk::MessageDialog dlg(Glib::locale_to_utf8(message), + Gtk::MessageDialog dlg(Glib::Markup::escape_text(Glib::locale_to_utf8(message)), true, Gtk::MESSAGE_INFO, Gtk::BUTTONS_CLOSE, true); dlg.set_title(title); @@ -82,7 +82,7 @@ int prompt_pimpl(string const & title, string const & question, Glib::ustring gb3; if (!b3.empty()) gb3 = Glib::locale_to_utf8(translateShortcut(b3)); - Gtk::MessageDialog dlg(Glib::locale_to_utf8(question), + Gtk::MessageDialog dlg(Glib::Markup::escape_text(Glib::locale_to_utf8(question)), true, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_NONE, true); dlg.set_title(title); @@ -98,7 +98,7 @@ int prompt_pimpl(string const & title, string const & question, std::pair const askForText_pimpl(string const & msg, string const & dflt) { - Gtk::MessageDialog dlg(Glib::locale_to_utf8(msg), + Gtk::MessageDialog dlg(Glib::Markup::escape_text(Glib::locale_to_utf8(msg)), true, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_OK_CANCEL, true); diff --git a/src/frontends/gtk/ChangeLog b/src/frontends/gtk/ChangeLog index e3da2b501d..30521acbfd 100644 --- a/src/frontends/gtk/ChangeLog +++ b/src/frontends/gtk/ChangeLog @@ -1,3 +1,7 @@ +2006-06-06 John Spray + * Alert_pimpl.C: escape special characters in strings before + passing them to Gtk::Dialog as markup + 2006-04-19 Bernhard Reiter * GExternal.[Ch], glade/external.glade: implement external dialog