From: speare Date: Sun, 8 Mar 2009 15:29:31 +0000 (+0000) Subject: xml tree widget also shows inkscape:label if any X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f6f90f9b2d20212c66df802c6345a319941d8f54;p=inkscape.git xml tree widget also shows inkscape:label if any --- diff --git a/src/widgets/sp-xmlview-tree.cpp b/src/widgets/sp-xmlview-tree.cpp index 698ee81ee..b757123b5 100644 --- a/src/widgets/sp-xmlview-tree.cpp +++ b/src/widgets/sp-xmlview-tree.cpp @@ -268,14 +268,21 @@ element_attr_changed (Inkscape::XML::Node * repr, const gchar * key, const gchar { NodeData * data; gchar *label; + const gchar *layer; data = (NodeData *) ptr; if (data->tree->blocked) return; - if (strcmp (key, "id")) return; + if (0 != strcmp (key, "id") && 0 != strcmp (key, "inkscape:label")) + return; - if (new_value) { + new_value = repr->attribute("id"); + layer = repr->attribute("inkscape:label"); + + if (new_value && layer) { + label = g_strdup_printf ("<%s id=\"%s\" inkscape:label=\"%s\">", repr->name(), new_value, layer); + } else if (new_value) { label = g_strdup_printf ("<%s id=\"%s\">", repr->name(), new_value); } else { label = g_strdup_printf ("<%s>", repr->name());