[LON-CAPA-cvs] cvs: loncom /interface/spreadsheet Spreadsheet.pm

matthew lon-capa-cvs@mail.lon-capa.org
Thu, 15 Jan 2004 21:20:07 -0000


matthew		Thu Jan 15 16:20:07 2004 EDT

  Modified files:              
    /loncom/interface/spreadsheet	Spreadsheet.pm 
  Log:
  Fix to xml output of template cells.
  
  
Index: loncom/interface/spreadsheet/Spreadsheet.pm
diff -u loncom/interface/spreadsheet/Spreadsheet.pm:1.33 loncom/interface/spreadsheet/Spreadsheet.pm:1.34
--- loncom/interface/spreadsheet/Spreadsheet.pm:1.33	Wed Jan 14 11:47:39 2004
+++ loncom/interface/spreadsheet/Spreadsheet.pm	Thu Jan 15 16:20:07 2004
@@ -1,5 +1,5 @@
 #
-# $Id: Spreadsheet.pm,v 1.33 2004/01/14 16:47:39 matthew Exp $
+# $Id: Spreadsheet.pm,v 1.34 2004/01/15 21:20:07 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1557,7 +1557,7 @@
     ## But not on this day
     my $Str = '<spreadsheet type="'.$self->{'type'}.'">'."\n";
     while (my ($cell,$formula) = each(%{$self->{'formulas'}})) {
-        if ($cell =~ /^template_(\d+)/) {
+        if ($cell =~ /^template_(\w+)/) {
             my $col = $1;
             $Str .= '<template col="'.$col.'">'.$formula.'</template>'."\n";
         } else {
@@ -1570,7 +1570,7 @@
         }
     }
     $Str.="</spreadsheet>";
-#    $r->print("<pre>\n\n\n".$Str."\n\n\n</pre>");
+    $r->print("<pre>\n\n\n".$Str."\n\n\n</pre>");
     return $Str;
 }
 
@@ -1597,8 +1597,7 @@
                 $formulas{$cell} = $formula;
                 $sources{$cell}  = $source if (defined($source));
                 $parser->get_text('/field');
-            }
-            if ($token->[1] eq 'template') {
+            } elsif ($token->[1] eq 'template') {
                 $formulas{'template_'.$token->[2]->{'col'}}=
                     $parser->get_text('/template');
             }