| 1 | package Excel::Template::TextObject; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | BEGIN { | ||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use vars qw(@ISA); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | @ISA = qw(Excel::Template::Base); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use Excel::Template::Base; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | } | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | # This is a helper object. It is not instantiated by the user, | ||||||||||||||||||||||||||||
| 13 | # nor does it represent an XML object. Rather, certain elements, | ||||||||||||||||||||||||||||
| 14 | # such as <textbox>, can use this object to do text with variable | ||||||||||||||||||||||||||||
| 15 | # substitutions. | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | sub new | ||||||||||||||||||||||||||||
| 18 | { | ||||||||||||||||||||||||||||
| 19 | 0 | ▶ | my $class = shift; | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 20 | 0 | my $self = $class->SUPER::new(@_); | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | $self->{STACK} = [] | ||||||||||||||||||||||||||||
| 23 | unless defined $self->{STACK} && | ||||||||||||||||||||||||||||
| 24 | 0 | ▶ | ref $self->{STACK} eq 'ARRAY'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $self->{"STACK"} and ref $self->{"STACK"} eq "ARRAY"
MC/DC0%0/2
defined $self->{"STACK"} and ref $self->{"STACK"} eq "ARRAY"
defined $self->{"STACK"}
ref $self->{"STACK"} eq "ARRAY"
Truth table0%0/3
A and B
A= defined $self->{"STACK"}B= ref $self->{"STACK"} eq "ARRAY"
| |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | return $self; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | sub resolve | ||||||||||||||||||||||||||||
| 30 | { | ||||||||||||||||||||||||||||
| 31 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
resolve: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 32 | 0 | my ($context) = @_; | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 0 | my $use_unicode = $context->use_unicode; | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 0 | my $t; | |||||||||||||||||||||||||||
| 37 | 0 | ▶ | if ($use_unicode) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | { | ||||||||||||||||||||||||||||
| 39 | 0 | require Unicode::String; | |||||||||||||||||||||||||||
| 40 | 0 | $t = Unicode::String::utf8(''); | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | else | ||||||||||||||||||||||||||||
| 43 | { | ||||||||||||||||||||||||||||
| 44 | 0 | $t = ''; | |||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 0 | for my $tok (@{$self->{STACK}}) | |||||||||||||||||||||||||||
| 48 | { | ||||||||||||||||||||||||||||
| 49 | 0 | my $val = $tok; | |||||||||||||||||||||||||||
| 50 | 0 | ▶ | $val = $val->resolve($context) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 51 | if Excel::Template::Factory::is_embedded( $val ); | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 0 | ▶ | $t .= $use_unicode | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 54 | ? Unicode::String::utf8("$val") | ||||||||||||||||||||||||||||
| 55 | : $val; | ||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 0 | return $t; | |||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | 1 | 1; | |||||||||||||||||||||||||||
| 62 | __END__ | ||||||||||||||||||||||||||||