Properly escape marked up text in dictionary views
[pspp-builds.git] / src / ui / gui / dict-display.c
index d665edd62be1872f5cede3a2515f791344145e1f..a8e9237a7edbb38c065e5d2c0f52dc6064fef862 100644 (file)
@@ -24,6 +24,7 @@
 #include "psppire-dict.h"
 #include "helper.h"
 #include <data/variable.h>
+#include <data/format.h>
 
 #define _(msgid) gettext (msgid)
 #define N_(msgid) msgid
@@ -135,7 +136,7 @@ var_description_cell_data_func (GtkTreeViewColumn *col,
 
   if ( var_has_label (var))
     {
-      gchar *text = g_strdup_printf (
+      gchar *text = g_markup_printf_escaped (
                                     "<span stretch=\"condensed\">%s</span>",
                                     var_get_label (var));
 
@@ -153,6 +154,7 @@ var_description_cell_data_func (GtkTreeViewColumn *col,
 }
 
 
+#if GTK_CHECK_VERSION (2, 12, 0)
 /* Sets the tooltip to be the name of the variable under the cursor */
 static gboolean
 set_tooltip_for_variable (GtkTreeView  *treeview,
@@ -170,6 +172,7 @@ set_tooltip_for_variable (GtkTreeView  *treeview,
   struct variable *var = NULL;
   gboolean ok;
 
+
   gtk_tree_view_convert_widget_to_bin_window_coords (treeview,
                                                      x, y, &bx, &by);
 
@@ -198,6 +201,7 @@ set_tooltip_for_variable (GtkTreeView  *treeview,
 
   return TRUE;
 }
+#endif
 
    /* Sets up TREEVIEW to display the variables of DICT.
    MODE is the selection mode for TREEVIEW.
@@ -268,7 +272,9 @@ attach_dictionary_to_treeview (GtkTreeView *treeview, PsppireDict *dict,
 
   g_object_set (treeview, "has-tooltip", TRUE, NULL);
 
+#if GTK_CHECK_VERSION (2, 12, 0)
   g_signal_connect (treeview, "query-tooltip", G_CALLBACK (set_tooltip_for_variable), NULL);
+#endif
 }