line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Excel::Cell; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
26
|
use 5.010; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
54
|
|
4
|
1
|
|
|
1
|
|
15
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
6
|
1
|
|
|
1
|
|
5
|
use base qw(Object); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1273
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
0
|
|
|
0
|
0
|
|
my ( $pkg, @config ) = @_; |
10
|
0
|
|
|
|
|
|
my $cell = { |
11
|
|
|
|
|
|
|
value => "", |
12
|
|
|
|
|
|
|
width => 10, |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
border_left => { |
15
|
|
|
|
|
|
|
width => 0, |
16
|
|
|
|
|
|
|
style => 'none', |
17
|
|
|
|
|
|
|
color => 0x0000ff, |
18
|
|
|
|
|
|
|
}, |
19
|
|
|
|
|
|
|
border_bottom => { |
20
|
|
|
|
|
|
|
width => 0, |
21
|
|
|
|
|
|
|
style => 'none', |
22
|
|
|
|
|
|
|
color => 0x0000ff, |
23
|
|
|
|
|
|
|
}, |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
#end of default config |
26
|
|
|
|
|
|
|
@config, |
27
|
|
|
|
|
|
|
}; |
28
|
0
|
|
|
|
|
|
return bless $cell, $pkg; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub value { |
32
|
0
|
|
|
0
|
0
|
|
my ( $self, $new_val ) = @_; |
33
|
0
|
0
|
|
|
|
|
if ( defined $new_val ) { |
34
|
0
|
|
|
|
|
|
$self->{value} = $new_val; |
35
|
0
|
|
|
|
|
|
return $self; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
else { |
38
|
0
|
|
|
|
|
|
return $self->{value}; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub border_left { |
43
|
0
|
|
|
0
|
0
|
|
my ( $self, $width, $style, $color ) = @_; |
44
|
0
|
0
|
|
|
|
|
if ( scalar(@_) > 1 ) { |
45
|
0
|
|
|
|
|
|
$self->{border_left} = { |
46
|
|
|
|
|
|
|
width => $width, |
47
|
|
|
|
|
|
|
style => $style, |
48
|
|
|
|
|
|
|
color => $color, |
49
|
|
|
|
|
|
|
}; |
50
|
0
|
|
|
|
|
|
return $self; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
else { |
53
|
0
|
|
|
|
|
|
my $border_left = $self->{border_left}; |
54
|
|
|
|
|
|
|
return |
55
|
0
|
|
|
|
|
|
$border_left->{width} . ', ' |
56
|
|
|
|
|
|
|
. $border_left->{style} . ', ' |
57
|
|
|
|
|
|
|
. sprintf( "0x%.6x", $border_left->{color} ); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub border_bottom { |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
0
|
0
|
|
my ( $self, $width, $style, $color ) = @_; |
65
|
0
|
0
|
|
|
|
|
if ( scalar(@_) > 1 ) { |
66
|
0
|
|
|
|
|
|
$self->{border_bottom} = { |
67
|
|
|
|
|
|
|
width => $width, |
68
|
|
|
|
|
|
|
style => $style, |
69
|
|
|
|
|
|
|
color => $color, |
70
|
|
|
|
|
|
|
}; |
71
|
0
|
|
|
|
|
|
return $self; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
else { |
74
|
0
|
|
|
|
|
|
my $border_bottom = $self->{border_bottom}; |
75
|
|
|
|
|
|
|
return |
76
|
0
|
|
|
|
|
|
$border_bottom->{width} . ', ' |
77
|
|
|
|
|
|
|
. $border_bottom->{style} . ', ' |
78
|
|
|
|
|
|
|
. sprintf( "0x%.6x", $border_bottom->{color} ); |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub width { |
83
|
0
|
|
|
0
|
0
|
|
my ( $self, $new_val ) = @_; |
84
|
0
|
0
|
|
|
|
|
if ( defined $new_val ) { |
85
|
0
|
|
|
|
|
|
$self->{width} = $new_val; |
86
|
0
|
|
|
|
|
|
return $self; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
else { |
89
|
0
|
|
|
|
|
|
return $self->{width}; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub english_to_num { |
94
|
0
|
|
|
0
|
0
|
|
my ( $class, $width, $style ) = @_; |
95
|
0
|
|
|
|
|
|
given ( lc $style ) { |
96
|
0
|
|
|
|
|
|
when ('solid') { |
97
|
0
|
|
|
|
|
|
given ($width) { |
98
|
0
|
|
|
|
|
|
when (0) { return 7; } |
|
0
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
when (1) { return 1; } |
|
0
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
|
when (2) { return 2; } |
|
0
|
|
|
|
|
|
|
101
|
0
|
|
|
|
|
|
when (3) { return 5; } |
|
0
|
|
|
|
|
|
|
102
|
0
|
|
|
|
|
|
default { return 7; } |
|
0
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
} |
105
|
0
|
|
|
|
|
|
when ('dash') { |
106
|
0
|
|
|
|
|
|
given ($width) { |
107
|
0
|
|
|
|
|
|
when (1) { return 3; } |
|
0
|
|
|
|
|
|
|
108
|
0
|
|
|
|
|
|
when (2) { return 8; } |
|
0
|
|
|
|
|
|
|
109
|
0
|
|
|
|
|
|
default { return 3; } |
|
0
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
} |
112
|
0
|
|
|
|
|
|
when ('dash dot') { |
113
|
0
|
|
|
|
|
|
given ($width) { |
114
|
0
|
|
|
|
|
|
when (1) { return 9; } |
|
0
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
when (2) { return 10; } |
|
0
|
|
|
|
|
|
|
116
|
0
|
|
|
|
|
|
default { return 9; } |
|
0
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
} |
119
|
0
|
|
|
|
|
|
when ('dash dot dot') { |
120
|
0
|
|
|
|
|
|
given ($width) { |
121
|
0
|
|
|
|
|
|
when (1) { return 11; } |
|
0
|
|
|
|
|
|
|
122
|
0
|
|
|
|
|
|
when (2) { return 12; } |
|
0
|
|
|
|
|
|
|
123
|
0
|
|
|
|
|
|
default { return 11; } |
|
0
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
} |
126
|
0
|
|
|
|
|
|
when ('dot') { |
127
|
0
|
|
|
|
|
|
return 4; |
128
|
|
|
|
|
|
|
} |
129
|
0
|
|
|
|
|
|
when ('slantdash dot') { |
130
|
0
|
|
|
|
|
|
return 13; |
131
|
|
|
|
|
|
|
} |
132
|
0
|
|
|
|
|
|
when ('double') { |
133
|
0
|
|
|
|
|
|
return 6; |
134
|
|
|
|
|
|
|
} |
135
|
0
|
|
|
|
|
|
default { return 0; } #none |
|
0
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub num_to_english { |
140
|
0
|
|
|
0
|
0
|
|
my ( $class, $index ) = @_; |
141
|
0
|
|
|
|
|
|
given ($index) { |
142
|
0
|
|
|
|
|
|
when (0) { return ( 'none', 0 ); } |
|
0
|
|
|
|
|
|
|
143
|
0
|
|
|
|
|
|
when (1) { return ( 'solid', 1 ); } |
|
0
|
|
|
|
|
|
|
144
|
0
|
|
|
|
|
|
when (2) { return ( 'solid', 2 ); } |
|
0
|
|
|
|
|
|
|
145
|
0
|
|
|
|
|
|
when (3) { return ( 'dash', 1 ); } |
|
0
|
|
|
|
|
|
|
146
|
0
|
|
|
|
|
|
when (4) { return ( 'dot', 1 ); } |
|
0
|
|
|
|
|
|
|
147
|
0
|
|
|
|
|
|
when (5) { return ( 'solid', 3 ); } |
|
0
|
|
|
|
|
|
|
148
|
0
|
|
|
|
|
|
when (6) { return ( 'double', 3 ); } |
|
0
|
|
|
|
|
|
|
149
|
0
|
|
|
|
|
|
when (7) { return ( 'solid', 0 ); } |
|
0
|
|
|
|
|
|
|
150
|
0
|
|
|
|
|
|
when (8) { return ( 'dash', 2 ); } |
|
0
|
|
|
|
|
|
|
151
|
0
|
|
|
|
|
|
when (9) { return ( 'dash dot', 1 ); } |
|
0
|
|
|
|
|
|
|
152
|
0
|
|
|
|
|
|
when (10) { return ( 'dash dot', 2 ); } |
|
0
|
|
|
|
|
|
|
153
|
0
|
|
|
|
|
|
when (11) { return ( 'dash dot dot', 1 ); } |
|
0
|
|
|
|
|
|
|
154
|
0
|
|
|
|
|
|
when (12) { return ( 'dash dot dot', 2 ); } |
|
0
|
|
|
|
|
|
|
155
|
0
|
|
|
|
|
|
when (13) { return ( 'slantdash dot', 2 ); } |
|
0
|
|
|
|
|
|
|
156
|
0
|
|
|
|
|
|
default { return ( 'none', 0 ); } |
|
0
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
} |
159
|
|
|
|
|
|
|
1; |