[dia] [diagram-tree] Fix tooltip filling with markup escape



commit 41930c37c2878439a961d4d3188992d7bf9708a8
Author: Hans Breuer <hans breuer org>
Date:   Sat Jul 31 17:24:43 2010 +0200

    [diagram-tree] Fix tooltip filling with markup escape
    
    Strings from diagrams may contain characters to be escaped before markup
    creation.

 app/diagram_tree_view.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/app/diagram_tree_view.c b/app/diagram_tree_view.c
index 6d30f68..24f51c0 100644
--- a/app/diagram_tree_view.c
+++ b/app/diagram_tree_view.c
@@ -157,19 +157,26 @@ _dtv_query_tooltip (GtkWidget  *widget,
 
       markup = g_string_new (NULL);
 
-      if (diagram)
-        g_string_append_printf (markup, "<b>%s</b>: %s\n", _("Diagram"), diagram->filename);
+      if (diagram) {
+        gchar *em = g_markup_printf_escaped ("<b>%s</b>: %s\n", _("Diagram"), diagram->filename);
+        g_string_append (markup, em);
+        g_free (em);
+      }
 
       if (layer) {
         gchar *name = layer_get_name (layer);
-        g_string_append_printf (markup, "<b>%s</b>: %s\n", _("Layer"), name);
+        gchar *em = g_markup_printf_escaped ("<b>%s</b>: %s\n", _("Layer"), name);
+        g_string_append (markup, em);
+        g_free (em);
         g_free (name);
       } else if (diagram) {
 	g_string_append_printf (markup, "%d %s", 
 			        data_layer_count (DIA_DIAGRAM_DATA(diagram)), _("Layer(s)"));
       }
       if (object) {
-        g_string_append_printf (markup, "<b>%s</b>: %s\n", _("Type"), object->type->name);
+        gchar *em = g_markup_printf_escaped ("<b>%s</b>: %s\n", _("Type"), object->type->name);
+        g_string_append (markup, em);
+        g_free (em);
         g_string_append_printf (markup, "<b>%s</b>: %g,%g\n", _("Position"), 
 			        object->position.x, object->position.y);
 	g_string_append_printf (markup, "%d %s", 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]