[Tkabber-dev] r512 - trunk/plugins/vimage/lib/viewer

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Feb 26 01:27:45 MSK 2012


Author: rejjin
Date: 2012-02-26 01:27:45 +0400 (Sun, 26 Feb 2012)
New Revision: 512

Modified:
   trunk/plugins/vimage/lib/viewer/viewer.tcl
Log:
Fixed small bugs.

Modified: trunk/plugins/vimage/lib/viewer/viewer.tcl
===================================================================
--- trunk/plugins/vimage/lib/viewer/viewer.tcl	2012-02-25 21:13:02 UTC (rev 511)
+++ trunk/plugins/vimage/lib/viewer/viewer.tcl	2012-02-25 21:27:45 UTC (rev 512)
@@ -516,6 +516,8 @@
 
 	$state(listbox) delete 0 end
 	
+    SetHeader $self ""
+    
 	set groups [lsort [array names state groups,*]]
 	
 	# Without history style.
@@ -600,6 +602,10 @@
 
 	upvar #0 [namespace current]::$self state
 	
+    if {![info exist state(current,inserttext)]} {
+    return
+    }
+    
 	set inserttext $state(current,inserttext)
 	
 	switch -- $type {
@@ -710,6 +716,10 @@
 
 	upvar #0 [namespace current]::$self state
 	
+    if {![info exist state(current,inserttext)]} {
+    return
+    }
+    
 	set inserttext $state(current,inserttext)
 	
 	if {[string length $state(data,$inserttext)] == 0} {
@@ -740,6 +750,9 @@
 
 proc viewer::free_all {self} {
     upvar #0 [namespace current]::$self state
+    if {![info exist state(current,inserttext)]} {
+    return
+    }
     set groups [lsort [array names state groups,*]]
     foreach group $groups {
         lassign [split $group ,] - url
@@ -753,6 +766,7 @@
         }
     }
     
+    unset state(current,inserttext)
     HistoryRedraw $self {}
 }
 
@@ -796,7 +810,10 @@
 	variable scales
     
     upvar #0 [namespace current]::$self state
-	
+	if {![info exist state(current,inserttext)]} {
+    return
+    }
+    
 	set inserttext $state(current,inserttext)
 	
 	if {[string equal $xfactor "normal"]} {



More information about the Tkabber-dev mailing list