Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-q committed Mar 17, 2016
1 parent 68b9466 commit 29ac131
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions xlsx_table.pl
Original file line number Diff line number Diff line change
Expand Up @@ -66,32 +66,34 @@ =head1 SYNOPSIS
my $format = { NORMAL => $newbook->add_format( color => 'black', %font, ), };
my $format_set = {};

for my $i ( 0 .. scalar @{$borders} ) {
for my $i ( 0 .. scalar @{$borders} - 1 ) {
printf "[Borders]\n";

my $range = $borders->[$i]{range};
printf " " x 4 . "[%s]\n", $range;

my ( $row1, $col1, $row2, $col2 ) = range_to_rowcol($range);
my $set = Set::Scalar->new;
for my $row ( $row1 .. $row2 ) {
for my $col ( $col1 .. $col2 ) {
$set->insert("$row-$col");
}
}
$format_set->{$i} = $set;

my $format = $newbook->add_format( color => 'black', %font, );
$format->{$i} = $newbook->add_format( color => 'black', %font, );
if ( $borders->[$i]{top} ) {
$format->set_top(1);
$format->{$i}->set_top(1);
}
if ( $borders->[$i]{bottom} ) {
$format->set_bottom(1);
$format->{$i}->set_bottom(1);
}
if ( $borders->[$i]{left} ) {
$format->set_left(1);
$format->{$i}->set_left(1);
}
if ( $borders->[$i]{right} ) {
$format->set_right(1);
$format->{$i}->set_right(1);
}

$format_set->{$i} = $set;
$format->{$i} = $format;
}

#----------------------------------------------------------#
Expand Down

0 comments on commit 29ac131

Please sign in to comment.