Commit 9a6cd145 authored by zak@balfor.local's avatar zak@balfor.local
Browse files

Minor changes to allow colspec numbering

parent 672e42ca
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -48,3 +48,4 @@ venu@work.mysql.com
zak@linux.local
jcole@mugatu.spaceapes.com
arjen@fred.bitbike.com
zak@balfor.local
+4 −2
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ sub msg {

sub rel2abs {
    my $str = shift;
    my $colnum = 1;
    
    my @widths = ();
    my $total  = 0;
@@ -45,7 +46,8 @@ sub rel2abs {
    my $unit = ($table_width - ($#widths * $gutter_width)) / ($total);

    foreach (@widths) {
        $output .= $ws . '<colspec colwidth="'. sprintf ("%0.2f", $_ * $unit) .'cm" />' . "\n";
        $output .= $ws . '<colspec colnum="'. $colnum .'" colwidth="'. sprintf ("%0.2f", $_ * $unit) .'cm" />' . "\n";
        ++$colnum;
    }
    
    return $output . "\n$ws";