From 676da141358384bc329e75ffb585d7c9f300bf13 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 4 Jun 2013 17:52:56 -0500 Subject: not sure what's going on here some places say that solid fills use the fg color, and other places say that they use the bg color, and so i'm not sure what to do here. should look into this more. --- lib/Spreadsheet/Template/Generator/Parser/Excel.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Spreadsheet/Template/Generator/Parser/Excel.pm b/lib/Spreadsheet/Template/Generator/Parser/Excel.pm index 6348147..d81ebbd 100644 --- a/lib/Spreadsheet/Template/Generator/Parser/Excel.pm +++ b/lib/Spreadsheet/Template/Generator/Parser/Excel.pm @@ -167,8 +167,15 @@ sub _parse_cell { if (!$format->{IgnoreFill}) { 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]; + # XXX this seems pretty wrong, but... not sure what the + # actually right way is, and this works for now + if ($format_data->{pattern} eq 'solid') { + $format_data->{bg_color} = $format->{Fill}[1]; + } + else { + $format_data->{fg_color} = $format->{Fill}[1]; + $format_data->{bg_color} = $format->{Fill}[2]; + } } } if (!$format->{IgnoreBorder}) { -- cgit v1.2.3-54-g00ecf