[LON-CAPA-cvs] cvs: loncom /xml londefdef.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Tue, 26 Jun 2007 01:36:49 -0000


albertel		Mon Jun 25 21:36:49 2007 EDT

  Modified files:              
    /loncom/xml	londefdef.pm 
  Log:
  - BUG#5301, current ends up being 0 when a user does 
    <table>stuff</table> with no <tr> or <td>
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.370 loncom/xml/londefdef.pm:1.371
--- loncom/xml/londefdef.pm:1.370	Mon Jun 25 21:20:35 2007
+++ loncom/xml/londefdef.pm	Mon Jun 25 21:36:48 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.370 2007/06/26 01:20:35 albertel Exp $
+# $Id: londefdef.pm,v 1.371 2007/06/26 01:36:48 albertel Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -2258,6 +2258,9 @@
 	for (my $i=0;$i<=$#fwidth;$i++) {  
 	    $current+=$fwidth[$i];
 	}
+	if ($current == 0) {
+            $current = $Apache::londefdef::table[-1]{'width'};
+        }
 	my $coef=$Apache::londefdef::table[-1]{'width'}/$current;
 	for (my $i=0;$i<=$#fwidth;$i++) {  
 	    $fwidth[$i]*=$coef;