Diff for /loncom/xml/lontable.pm between versions 1.15 and 1.16

version 1.15, 2010/11/18 17:12:14 version 1.16, 2011/04/05 10:02:58
Line 347  Set or get the presence of a request for Line 347  Set or get the presence of a request for
 drawn around them.  If a paramter is passed, it will be treated as  drawn around them.  If a paramter is passed, it will be treated as
 a new value for the cell border configuration.  Regardless,the final  a new value for the cell border configuration.  Regardless,the final
 value of that configuration parameter is returned.  value of that configuration parameter is returned.
   Valid values for the parameter are:
   
   =over 2
   
   =item 0 - no borders present.
   
   =item 1 - All borders (borders around all four sides of the cell.
   
   =item 2 - Border at top and bottom of the cell.
   
   =item 3 - Border at the left and right sides of the cell.
   
   
   =over -2 
   
 =head3 Examples:  =head3 Examples:
   
Line 846  sub generate { Line 860  sub generate {
     my $outer_border = $this->{'outer_border'};      my $outer_border = $this->{'outer_border'};
     my $column_count = $this->{'column_count'};      my $column_count = $this->{'column_count'};
   
       my $cell_ul_border = (($inner_border == 1) || ($inner_border == 2)) ? 1 : 0;
       my $cell_lr_border = (($inner_border == 1) || ($inner_border == 3)) ? 1 : 0;
    
     # Add a top line if the outer or inner border is enabled:      # Add a top line if the outer or inner border is enabled:
   
     if ($outer_border || $inner_border) {      if ($outer_border || $cell_ul_border) {
  push(@data, ["\\cline{1-$column_count}"]);        push(@data, ["\\cline{1-$column_count}"]);     
   
     }      }
Line 908  sub generate { Line 925  sub generate {
  $contents = $embeddedAlignStart . $contents .  $embeddedAlignEnd;   $contents = $embeddedAlignStart . $contents .  $embeddedAlignEnd;
     }      }
   
     if ($inner_border || ($outer_border && ($cell == 0))) {      if ($cell_lr_border || ($outer_border && ($cell == 0))) {
  $col_align = '|'.$col_align;   $col_align = '|'.$col_align;
     }      }
     if ($inner_border || ($outer_border && ($cell == ($cell_count -1)))) {      if ($cell_lr_border || ($outer_border && ($cell == ($cell_count -1)))) {
  $col_align = $col_align.'|';   $col_align = $col_align.'|';
     }      }
   
Line 935  sub generate { Line 952  sub generate {
     $contents .= '  \\\\';      $contents .= '  \\\\';
  }   }
     }      }
     if ($inner_border && ($cells->[$cell]->{'rowspan'} == 1)) {      if ($cell_ul_border && ($cells->[$cell]->{'rowspan'} == 1)) {
  my $lastcol = $nextcol -1;   my $lastcol = $nextcol -1;
  push(@underlines, "\\cline{$startcol-$lastcol}");   push(@underlines, "\\cline{$startcol-$lastcol}");
     }      }
Line 946  sub generate { Line 963  sub generate {
   
  }   }
  push(@data, \@row);   push(@data, \@row);
  if ($inner_border) {   if ($cell_ul_border) {
     for (my $i =0; $i < scalar(@underlines); $i++) {      for (my $i =0; $i < scalar(@underlines); $i++) {
  push(@data, [$underlines[$i]]);   push(@data, [$underlines[$i]]);
     }      }
Line 957  sub generate { Line 974  sub generate {
     # Add bottom border if necessary: if the inner border was on, the loops above      # Add bottom border if necessary: if the inner border was on, the loops above
     # will have done a bottom line under the last cell.      # will have done a bottom line under the last cell.
     #      #
     if ($outer_border && !$inner_border) {      if ($outer_border && !$cell_ul_border) {
  push(@data, ["\\cline{1-$column_count}"]);        push(@data, ["\\cline{1-$column_count}"]);     
   
     }      }
     $table->set_data(\@data);      $table->set_data(\@data);
           
     my $coldef = "";      my $coldef = "";
     if ($outer_border || $inner_border) {      if ($outer_border || $cell_lr_border) {
  $coldef .= '|';   $coldef .= '|';
     }      }
     for (my $i =0; $i < $column_count; $i++) {      for (my $i =0; $i < $column_count; $i++) {
Line 973  sub generate { Line 990  sub generate {
  } else {   } else {
     $coldef .= 'l';      $coldef .= 'l';
  }   }
  if ($inner_border ||    if ($cell_lr_border || 
     ($outer_border && ($i == $column_count-1))) {      ($outer_border && ($i == $column_count-1))) {
     $coldef .= '|';      $coldef .= '|';
  }   }

Removed from v.1.15  
changed lines
  Added in v.1.16


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>