Subject: | Bug about header_props and cell background colors |
Thanks for your module, it's great.
I found a bug in the table.pm line 602,
your code is :
#######################################################################
if ( $cell_props->[$row_cnt][$j]->{'background_color'} && ! $first_row )
{
$gfx_bg->fillcolor($cell_props->[$row_cnt][$j]->{'background_color'}
&& ! $first_row );
}
elsif( $col_props->[$j]->{'background_color'} )
{
$gfx_bg->fillcolor($col_props->[$j]->{'background_color'});
}
else
{
$gfx_bg->fillcolor($background_color);
}
$gfx_bg->fill();
#######################################################################
But the problem is:
Even if user don't defined the header_props, the color of the first
row will
still be background_color. I think it should be cell_props's color
or col_props's color. (Because, sometimes we need to set the
color of each header's background.)
I did a little on your code:
#######################################################################
if( $first_row && ref $header_props ){
$gfx_bg->fillcolor($col_props->[$j]->{'background_color'});
}
elsif ( $cell_props->[$row_cnt][$j]->{'background_color'} )
{
$gfx_bg->fillcolor($cell_props->[$row_cnt][$j]->{'background_color'} );
}
elsif( $col_props->[$j]->{'background_color'} )
{
$gfx_bg->fillcolor($col_props->[$j]->{'background_color'});
}
else
{
$gfx_bg->fillcolor($background_color);
}
$gfx_bg->fill();
#######################################################################
What do you think?
And I have some suggestions:
I hope the next version of this module could contain more
setting of border. (setting of border for each cell)
What do you think?