summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-06-04 13:51:53 -0500
committerJesse Luehrs <doy@tozt.net>2013-06-04 13:51:53 -0500
commit246c25fbebf1d2a06c3e764b1db2f72ac7d2ed8d (patch)
tree07d62f50eb3be981a8e15aa417e8760b9229f13e
parentbecbe194e6c98ef2687886edc8b65f5921501231 (diff)
downloadspreadsheet-template-246c25fbebf1d2a06c3e764b1db2f72ac7d2ed8d.tar.gz
spreadsheet-template-246c25fbebf1d2a06c3e764b1db2f72ac7d2ed8d.zip
better handling for fills
-rw-r--r--lib/Spreadsheet/Template/Generator/Parser/Excel.pm29
1 files changed, 27 insertions, 2 deletions
diff --git a/lib/Spreadsheet/Template/Generator/Parser/Excel.pm b/lib/Spreadsheet/Template/Generator/Parser/Excel.pm
index a7f97cd..6348147 100644
--- a/lib/Spreadsheet/Template/Generator/Parser/Excel.pm
+++ b/lib/Spreadsheet/Template/Generator/Parser/Excel.pm
@@ -137,14 +137,39 @@ sub _parse_cell {
13 => 'slant_dash_dot',
);
+ my %fill = (
+ 0 => 'none',
+ 1 => 'solid',
+ 2 => 'medium_gray',
+ 3 => 'dark_gray',
+ 4 => 'light_gray',
+ 5 => 'dark_horizontal',
+ 6 => 'dark_vertical',
+ 7 => 'dark_down',
+ 8 => 'dark_up',
+ 9 => 'dark_grid',
+ 10 => 'dark_trellis',
+ 11 => 'light_horizontal',
+ 12 => 'light_vertical',
+ 13 => 'light_down',
+ 14 => 'light_up',
+ 15 => 'light_grid',
+ 16 => 'light_trellis',
+ 17 => 'gray_125',
+ 18 => 'gray_0625',
+ );
+
if (!$format->{IgnoreFont}) {
$format_data->{size} = $format->{Font}{Height};
$format_data->{color} = $format->{Font}{Color}
unless lc($format->{Font}{Color}) eq '#ffffff'; # XXX
}
if (!$format->{IgnoreFill}) {
- $format_data->{bg_color} = $format->{Fill}[1]
- unless $format->{Fill}[1] eq '#000000'; # XXX
+ if ($format->{Fill}[0] != 0) {
+ $format_data->{pattern} = $fill{$format->{Fill}[0]};
+ $format_data->{fg_color} = $format->{Fill}[1];
+ $format_data->{bg_color} = $format->{Fill}[2];
+ }
}
if (!$format->{IgnoreBorder}) {
$format_data->{border_color} = $format->{BdrColor};