Properly escape marked up text in dictionary views
[pspp-builds.git] / src / ui / gui / dict-display.c
index 842441372155a04c847a6f3952cfb09d6df97e13..a8e9237a7edbb38c065e5d2c0f52dc6064fef862 100644 (file)
@@ -136,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));
 
@@ -154,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,
@@ -171,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);
 
@@ -199,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.
@@ -269,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
 }