summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-06-04 16:54:00 -0500
committerJesse Luehrs <doy@tozt.net>2013-06-04 16:54:00 -0500
commit84b2219f9eb2fc451b98153375749821dad6ee4d (patch)
treeff5c2e0ab3ae9052e5dff56c02610a612e8db0a8
parent246c25fbebf1d2a06c3e764b1db2f72ac7d2ed8d (diff)
downloadspreadsheet-template-84b2219f9eb2fc451b98153375749821dad6ee4d.tar.gz
spreadsheet-template-84b2219f9eb2fc451b98153375749821dad6ee4d.zip
remap fill pattern names
-rw-r--r--lib/Spreadsheet/Template/Writer/Excel.pm27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/Spreadsheet/Template/Writer/Excel.pm b/lib/Spreadsheet/Template/Writer/Excel.pm
index 6afa7d1..a4809e4 100644
--- a/lib/Spreadsheet/Template/Writer/Excel.pm
+++ b/lib/Spreadsheet/Template/Writer/Excel.pm
@@ -245,6 +245,33 @@ sub _format {
my $self = shift;
my ($format_properties) = @_;
+ my %pattern = (
+ none => 0,
+ solid => 1,
+ medium_gray => 2,
+ dark_gray => 3,
+ light_gray => 4,
+ dark_horizontal => 5,
+ dark_vertical => 6,
+ dark_down => 7,
+ dark_up => 8,
+ dark_grid => 9,
+ dark_trellis => 10,
+ light_horizontal => 11,
+ light_vertical => 12,
+ light_down => 13,
+ light_up => 14,
+ light_grid => 15,
+ light_trellis => 16,
+ gray_125 => 17,
+ gray_0625 => 18,
+ );
+
+ if (exists $format_properties->{pattern}) {
+ $format_properties->{pattern} = $pattern{$format_properties->{pattern}}
+ unless $format_properties->{pattern} =~ /^\d+$/;
+ }
+
my $key = JSON->new->canonical->encode($format_properties);
if (exists $self->_formats->{$key}) {
return $self->_formats->{$key};