[Tkabber-dev] r1180 - in trunk/tkabber: . plugins/general

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Fri Aug 10 22:10:18 MSD 2007


Author: sergei
Date: 2007-08-10 22:10:18 +0400 (Fri, 10 Aug 2007)
New Revision: 1180

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/general/rawxml.tcl
Log:
	* plugins/general/rawxml.tcl: Fixed bug with pretty-printing tags with
	  no attributes.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-08-09 08:36:39 UTC (rev 1179)
+++ trunk/tkabber/ChangeLog	2007-08-10 18:10:18 UTC (rev 1180)
@@ -1,3 +1,8 @@
+2007-08-10  Sergei Golovan  <sgolovan at nes.ru>
+
+	* plugins/general/rawxml.tcl: Fixed bug with pretty-printing tags with
+	  no attributes.
+
 2007-08-08  Sergei Golovan  <sgolovan at nes.ru>
 
 	* jabberlib-tclxml/socks4.tcl: Fixed checking SOCKS server response.

Modified: trunk/tkabber/plugins/general/rawxml.tcl
===================================================================
--- trunk/tkabber/plugins/general/rawxml.tcl	2007-08-09 08:36:39 UTC (rev 1179)
+++ trunk/tkabber/plugins/general/rawxml.tcl	2007-08-10 18:10:18 UTC (rev 1180)
@@ -108,8 +108,20 @@
 
     jlib::wrapper:splitxml $xmldata tagname vars isempty chdata subtags
 
+    set vars1 {}
+    foreach {attr value} $vars {
+	if {$attr == "xmlns"} {
+	    if {$value == $xmlns} {
+		continue
+	    } else {
+		set xmlns $value
+	    }
+	}
+	lappend vars1 $attr $value
+    }
+
     $t insert end "$prefix<" {} $tagname ${tag}tag
-    if {[llength $vars] != 0} {
+    if {[llength $vars1] != 0} {
 	#set attrprefix ${prefix}[string repeat " " \
 	#			     [expr {[clength $tagname] + 2}]]
 	set arr_index "$prefix<$tagname "
@@ -118,18 +130,6 @@
 	}
 	$t tag configure $arr_index -tabs [list $tabs($arr_index)]
 
-	set vars1 {}
-	foreach {attr value} $vars {
-	    if {$attr == "xmlns"} {
-		if {$value == $xmlns} {
-		    continue
-		} else {
-		    set xmlns $value
-		}
-	    }
-	    lappend vars1 $attr $value
-	}
-
 	set vars2 [lassign $vars1 attr value]
 	$t insert end \
 	    " $attr" ${tag}attr \



More information about the Tkabber-dev mailing list