From 176c2e79f2704af024e02d755b3dbb714ba72a70 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 9 Dec 2013 15:05:26 -0500 Subject: support more font properties (#14) --- t/bug-14.t | 35 +++++++++++++++++++++++++++++++++++ t/data/bug-14.xlsx | Bin 0 -> 5005 bytes 2 files changed, 35 insertions(+) create mode 100644 t/bug-14.t create mode 100644 t/data/bug-14.xlsx (limited to 't') diff --git a/t/bug-14.t b/t/bug-14.t new file mode 100644 index 0000000..3237b0b --- /dev/null +++ b/t/bug-14.t @@ -0,0 +1,35 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +use Spreadsheet::ParseXLSX; + +my $wb = Spreadsheet::ParseXLSX->new->parse('t/data/bug-14.xlsx'); +my $ws = $wb->worksheet(0); + +for my $row (0..6) { + for my $col ($row..6) { + next if $row == 5 && $col == 6; + + my $font = $ws->get_cell($row, $col)->get_format->{Font}; + is($font->{Name}, 'Arial'); + is(!!$font->{Bold}, $row == 1 || $col == 1); + is(!!$font->{Italic}, $row == 2 || $col == 2); + is($font->{Height}, 10); + is(!!$font->{Underline}, $row == 3 || $col == 3); + if ($row == 3 || $col == 3) { + is($font->{UnderlineStyle}, 1); + } + is($font->{Color}, '#000000'); + is(!!$font->{Strikeout}, $row == 4 || $col == 4); + is( + $font->{Super}, + $row == 5 || $col == 5 ? 2 + : $row == 6 || $col == 6 ? 1 + : 0 + ); + } +} + +done_testing; diff --git a/t/data/bug-14.xlsx b/t/data/bug-14.xlsx new file mode 100644 index 0000000..7dfa004 Binary files /dev/null and b/t/data/bug-14.xlsx differ -- cgit v1.2.3-54-g00ecf