summaryrefslogtreecommitdiff
path: root/gtk2_ardour/utils.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-06-12 14:19:35 +0000
committerCarl Hetherington <carl@carlh.net>2012-06-12 14:19:35 +0000
commitd7551a8f087483af2ef1eae4b0d6988585f03e79 (patch)
tree10ed44554b0cbb7dc2a0d67d93c317f47bbf024a /gtk2_ardour/utils.cc
parent1804efbd14a65943239cf5e447991e008b1aa05a (diff)
Escape angled brackets in playlist names for tooltips.
git-svn-id: svn://localhost/ardour2/branches/3.0@12672 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r--gtk2_ardour/utils.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index 96bee1a87b..b8594b7b2f 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -36,6 +36,7 @@
#include <gtkmm/label.h>
#include <gtkmm/paned.h>
#include <gtk/gtkpaned.h>
+#include <boost/algorithm/string.hpp>
#include "pbd/file_utils.h"
@@ -680,6 +681,16 @@ escape_underscores (string const & s)
return o;
}
+/** Replace < and > with &lt; and &gt; respectively to make < > display correctly in markup strings */
+string
+escape_angled_brackets (string const & s)
+{
+ string o = s;
+ boost::replace_all (o, "<", "&lt;");
+ boost::replace_all (o, ">", "&gt;");
+ return o;
+}
+
Gdk::Color
unique_random_color (list<Gdk::Color>& used_colors)
{