From a541e4e811fb2263f3e59f6f5aeeeb872e270718 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 23 Oct 2012 14:45:09 +0000 Subject: [PATCH] escape markup text that may contain non-legal characters (for GMarkup). this may need to be done more widely git-svn-id: svn://localhost/ardour2/branches/3.0@13318 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/port_matrix.cc | 4 ++-- gtk2_ardour/sfdb_ui.cc | 2 +- gtk2_ardour/splash.cc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index 8db2dad475..0fbbc03fb0 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -1009,10 +1009,10 @@ PortMatrix::update_tab_highlighting () string c = label->get_label (); if (c.length() && c[0] == '<' && !has_connection) { /* this label is marked up with but shouldn't be */ - label->set_markup ((*j)->name); + label->set_text ((*j)->name); } else if (c.length() && c[0] != '<' && has_connection) { /* this label is not marked up with but should be */ - label->set_markup (string_compose ("%1", (*j)->name)); + label->set_markup (string_compose ("%1", Glib::Markup::escape_text ((*j)->name))); } ++p; diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index d580418dac..eab34a6a0a 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -248,7 +248,7 @@ SoundFileBox::setup_labels (const string& filename) return false; } - preview_label.set_markup (string_compose ("%1", Glib::path_get_basename (filename))); + preview_label.set_markup (string_compose ("%1", Glib::Markup::escape_text (Glib::path_get_basename (filename)))); std::string n = sf_info.format_name; if (n.substr (0, 8) == X_("Format: ")) { n = n.substr (8); diff --git a/gtk2_ardour/splash.cc b/gtk2_ardour/splash.cc index ad7585e541..b2777eb48c 100644 --- a/gtk2_ardour/splash.cc +++ b/gtk2_ardour/splash.cc @@ -188,7 +188,7 @@ void Splash::message (const string& msg) { string str (""); - str += msg; + str += Glib::Markup::escape_text (msg); str += ""; layout->set_markup (str);