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

matthew lon-capa-cvs@mail.lon-capa.org
Thu, 30 Jan 2003 18:37:49 -0000


matthew		Thu Jan 30 13:37:49 2003 EDT

  Modified files:              
    /loncom/interface	lonspreadsheet.pm 
  Log:
  $self->rows() no longer returns row '0', the export row.
  
  
Index: loncom/interface/lonspreadsheet.pm
diff -u loncom/interface/lonspreadsheet.pm:1.165 loncom/interface/lonspreadsheet.pm:1.166
--- loncom/interface/lonspreadsheet.pm:1.165	Thu Jan 30 11:20:08 2003
+++ loncom/interface/lonspreadsheet.pm	Thu Jan 30 13:37:49 2003
@@ -1,5 +1,5 @@
 #
-# $Id: lonspreadsheet.pm,v 1.165 2003/01/30 16:20:08 matthew Exp $
+# $Id: lonspreadsheet.pm,v 1.166 2003/01/30 18:37:49 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1588,7 +1588,6 @@
     foreach my $col ($self->template_cells()) {
         next if ($col=~/^$pattern/);
         foreach my $trow ($self->rows()) {
-            next if ($trow eq '0');
             # Get the name of this cell
             my $lb=$col.$trow;
             # Grab the template declaration
@@ -1904,7 +1903,7 @@
     $self->{'rows'}=[];
     $self->{'template_cells'}=[];
     foreach my $cell($self->formulas_keys()) {
-        push(@{$self->{'rows'}},$1) if ($cell =~ /^A(\d+)/);
+        push(@{$self->{'rows'}},$1) if ($cell =~ /^A(\d+)/ && $1 != 0);
         push(@{$self->{'template_cells'}},$1) if ($cell =~ /^template_(\w+)/);
     }
     return;
@@ -2948,8 +2947,7 @@
             $self->{'maxrow'}= $rownum;
         }
         $existing{$f{$cell}}=1;
-        unless ((defined($currentlist{$f{$cell}})) || ($rownum ne '0') ||
-                ($f{$cell}=~/^(~~~|---)/)) {
+        if (! defined($currentlist{$f{$cell}}) && ($f{$cell}=~/^(~~~|---)/)) {
             $f{$cell}='!!! Obsolete';
             $changed=1;
         }
@@ -3099,7 +3097,6 @@
     foreach my $rownum ($self->rows()) {
         my $cell = 'A'.$rownum;
         my $formula = $f{$cell};
-        next if ($rownum eq '0');
         $self->{'maxrow'} = $rownum if ($rownum > $self->{'maxrow'});
         my ($usy,$ufn)=split(/__&&&\__/,$formula);
         $existing{$usy}=1;
@@ -3147,7 +3144,7 @@
         if(defined($c) && ($c->aborted())) {
             last;
         }
-        next if (($value =~ /^[!~-]/) || ($row==0));
+        next if ($value =~ /^[!~-]/);
         my ($usy,$ufn)=split(/__&&&\__/,$value);
         @assessdata=$self->exportsheet($self->{'uname'},
                                         $self->{'udom'},
@@ -3204,7 +3201,7 @@
             last;
         }
         my $cell = 'A'.$row;
-        next if (($formulas{$cell}=~/^[\!\~\-]/)  || ($row==0));
+        next if ($formulas{$cell}=~/^[\!\~\-]/);
         my ($sname,$sdom) = split(':',$formulas{$cell});
         my $started = time;
         my @studentdata=$self->exportsheet($sname,$sdom,'studentcalc',