Branch Coverage

blib/lib/PDF/Builder/Content/Text.pm
Criterion Covered Total %
branch 87 670 12.9


line true false branch
182 0 4 if (defined $opts{'-wordsp'} and not defined $opts{'wordsp'})
183 0 4 if (defined $opts{'-charsp'} and not defined $opts{'charsp'})
184 0 4 if (defined $opts{'-wordspa'} and not defined $opts{'wordspa'})
185 0 4 if (defined $opts{'-charspa'} and not defined $opts{'charspa'})
186 0 4 if (defined $opts{'-condw'} and not defined $opts{'condw'})
187 0 4 if (defined $opts{'-condc'} and not defined $opts{'condc'})
188 0 4 if (defined $opts{'-nocs'} and not defined $opts{'nocs'})
192 0 4 defined $opts{'wordsp'} ? :
194 0 4 defined $opts{'charsp'} ? :
196 0 4 defined $opts{'wordspa'} ? :
198 0 4 defined $opts{'charspa'} ? :
200 0 4 defined $opts{'condw'} ? :
202 0 4 defined $opts{'condc'} ? :
205 0 4 defined $opts{'nocs'} ? :
206 0 4 if ($nocs)
225 4 0 if (abs $overage > "0.1")
233 16 62 if ($chars[$i] eq " ")
239 0 4 if ($overage > 0) { }
242 0 0 if ($overage > 0 and $num_spaces > 0 and $condw > 0)
245 0 0 if ($val > $limit)
250 0 0 if ($overage > 0 and $num_chars > 0 and $condc > 0)
253 0 0 if ($val > $limit)
262 4 0 if ($overage > 0 and $num_spaces > 0 and $wordsp > 0)
265 1 3 if ($val > $limit)
270 1 0 if ($overage > 0 and $num_chars > 0 and $charsp > 0)
273 0 1 if ($val > $limit)
278 0 0 if ($overage > 0 and $num_spaces > 0 and $wordspa > 0)
281 0 0 if ($val > $limit)
286 0 0 if ($overage > 0 and $num_chars > 0 and $charspa > 0)
289 0 0 if ($val > $limit)
299 0 4 if ($overage > "0.1")
402 0 20 if (defined $opts{'-hyphenate'} and not defined $opts{'hyphenate'})
403 0 20 if (defined $opts{'-lang'} and not defined $opts{'lang'})
404 0 20 if (defined $opts{'-nosplit'} and not defined $opts{'nosplit'})
407 0 20 defined $opts{'hyphenate'} ? :
434 13 106 if $overflowed
438 13 7 if ($overflowed and not $over)
439 13 0 if ($hyphenate and @line == 1 or @line > 1)
453 0 20 if ($hyphenate and $overflowed)
465 0 0 if (@line) { }
475 0 0 if ($space > 0)
500 0 0 if ($@)
518 0 0 if (not @line) { }
522 0 0 if ($wordLeft eq '') { }
537 0 0 if ($wordLeft eq '') { }
543 0 0 if $wordRight ne ""
563 0 357 if ord $_ == 173
589 10 0 if (defined $opts{'-spillover'} and not defined $opts{'spillover'})
618 2 0 if (defined $opts{'-spillover'} and not defined $opts{'spillover'})
642 2 0 if (defined $opts{'-spillover'} and not defined $opts{'spillover'})
683 4 2 if (defined $opts{'-last_align'} and not defined $opts{'last_align'})
684 6 0 if (defined $opts{'-spillover'} and not defined $opts{'spillover'})
687 4 2 if (defined $opts{'last_align'})
688 0 4 if ($opts{'last_align'} =~ /^l/i) { }
2 2 elsif ($opts{'last_align'} =~ /^c/i) { }
2 0 elsif ($opts{'last_align'} =~ /^r/i) { }
697 3 3 if ($ret eq '') { }
699 1 2 if ($align eq 'l') { }
1 1 elsif ($align eq 'c') { }
797 5 7 if (defined $opts{'-align'} and not defined $opts{'align'})
798 0 12 if (defined $opts{'-pndnt'} and not defined $opts{'pndnt'})
804 5 7 if (defined $opts{'align'})
805 0 5 if ($opts{'align'} =~ /^l/i) { }
1 4 elsif ($opts{'align'} =~ /^c/i) { }
1 3 elsif ($opts{'align'} =~ /^r/i) { }
3 0 elsif ($opts{'align'} =~ /^j/i) { }
811 0 12 defined $opts{'pndnt'} ? :
812 1 11 if ($align eq "c")
822 0 20 if ($indent > 0 and $first_line)
823 0 20 if ($indent < 0 and not $first_line)
825 0 0 if ($lw < $width and $align eq 'l' || $align eq 'j')
830 6 14 if ($align eq 'j') { }
2 12 elsif ($align eq 'r') { }
2 10 elsif ($align eq 'c') { }
844 3 17 if ($height -= $leading) < 0
847 6 6 if (wantarray)
900 0 2 if (defined $opts{'-pvgap'} and not defined $opts{'pvgap'})
903 0 2 defined $opts{'pvgap'} ? :
913 0 6 if (length $overflow > 0)
919 2 4 if (length $para > 0)
928 0 6 if (length $para == 0 and $pvgap != 0)
934 0 2 if (wantarray)
1038 0 0 if (defined $opts{'-rotate'} and not defined $opts{'rotate'})
1039 0 0 if (defined $opts{'-color'} and not defined $opts{'color'})
1040 0 0 if (defined $opts{'-strokecolor'} and not defined $opts{'strokecolor'})
1041 0 0 if (defined $opts{'-charspace'} and not defined $opts{'charspace'})
1042 0 0 if (defined $opts{'-hscale'} and not defined $opts{'hscale'})
1043 0 0 if (defined $opts{'-wordspace'} and not defined $opts{'wordspace'})
1044 0 0 if (defined $opts{'-render'} and not defined $opts{'render'})
1045 0 0 if (defined $opts{'-right'} and not defined $opts{'right'})
1046 0 0 if (defined $opts{'-center'} and not defined $opts{'center'})
1047 0 0 if (defined $opts{'-left'} and not defined $opts{'left'})
1048 0 0 if (defined $opts{'-align'} and not defined $opts{'align'})
1053 0 0 if defined $opts{'rotate'}
1056 0 0 if ($wastext)
1065 0 0 ref $opts{'color'} ? :
0 0 if defined $opts{'color'}
1066 0 0 ref $opts{'strokecolor'} ? :
0 0 if defined $opts{'strokecolor'}
1070 0 0 if defined $opts{'charspace'}
1071 0 0 if defined $opts{'hscale'}
1072 0 0 if defined $opts{'wordspace'}
1073 0 0 if defined $opts{'render'}
1075 0 0 if (defined $opts{'right'} and $opts{'right'} or defined $opts{'align'} and $opts{'align'} =~ /^r/i) { }
0 0 elsif (defined $opts{'center'} and $opts{'center'} or defined $opts{'align'} and $opts{'align'} =~ /^c/i) { }
0 0 elsif (defined $opts{'left'} and $opts{'left'} or defined $opts{'align'} and $opts{'align'} =~ /^l/i) { }
1091 0 0 if ($wastext)
1697 0 0 if ($text->{' fontsize'} > 0)
1698 0 0 if (defined $opts{'font_size'})
1701 0 0 if (defined $opts{'leading'})
1703 0 0 if (defined $opts{'marker_width'})
1706 0 0 if (defined $opts{'restore'})
1712 0 0 if (defined $grfx and ref($grfx) =~ /^PDF::Builder::Content=HASH/) { }
1727 0 0 if defined $opts{'outline'}
1736 0 0 if defined $opts{'start_y'}
1737 0 0 if ($start_y != $col_max_y)
1763 0 0 if ($rc > 1)
1769 0 0 if (defined $grfx and ref($grfx) =~ /^PDF::Builder::Content=HASH/) { }
1792 0 0 if (@cur_color == 1) { }
1834 0 0 if (defined $opts{'para'})
1847 0 0 if defined $opts{'color'}
1995 0 0 if (ref $mytext[$el] ne "HASH")
1996 0 0 if ($mytext[$el]{'tag'} eq "")
1999 0 0 unless (defined $tag)
2000 0 0 if ($tag =~ m[^/])
2004 0 0 if ($tag eq "font")
2005 0 0 if (defined $mytext[$el]{'face'})
2008 0 0 if (defined $mytext[$el]{'size'})
2014 0 0 if ($tag eq "ol")
2015 0 0 if (defined $mytext[$el]{'type'})
2019 0 0 if ($tag eq "ul")
2020 0 0 if (defined $mytext[$el]{'type'})
2024 0 0 if ($tag eq "li")
2025 0 0 if (defined $mytext[$el]{'type'})
2029 0 0 if ($tag eq "a")
2030 0 0 if (defined $mytext[$el]{'href'})
2034 0 0 if ($tag eq "hr")
2035 0 0 if (defined $mytext[$el]{'size'})
2041 0 0 if (defined $mytext[$el]{'style'})
2054 0 0 if ($tag eq "br" or $tag eq "hr" or $tag eq "img" or $tag eq "area" or $tag eq "base" or $tag eq "col" or $tag eq "embed" or $tag eq "input" or $tag eq "link" or $tag eq "meta" or $tag eq "source" or $tag eq "track" or $tag eq "wbr" or $tag eq "defaults" or $tag eq "style")
2116 0 0 if (ref $mytext[$el] ne "HASH")
2117 0 0 unless (keys %{$mytext[$el];})
2119 0 0 if ($mytext[$el]{'text'} eq '') { }
2129 0 0 if (substr($tag, 0, 1) ne '/') { }
2164 0 0 if (defined $mytext[$el]{'class'})
2171 0 0 if (defined $mytext[$el]{'id'})
2184 0 0 if ($properties[-1]{'display'} eq "block")
2200 0 0 if ($tag eq "p")
2206 0 0 if ($para) { }
2215 0 0 if (defined $mytext[$el]{'cont'} and $mytext[$el]{'cont'})
2226 0 0 if ($tag eq "ul")
2229 0 0 if ($tag eq "ol")
2231 0 0 if (defined $mytext[$el]{'start'})
2236 0 0 if ($tag eq "li")
2240 0 0 if (defined $mytext[$el]{'value'})
2248 0 0 if (substr($list_marker, 0, 1) eq '.') { }
2266 0 0 if ($tag eq "li")
2277 0 0 if ($tag eq "hr")
2296 0 0 if ($properties[-1]{'width'} > 0 and $properties[-1]{'width'} < $width)
2355 0 0 if ($tag eq "style")
2360 0 0 if (defined $mytext[$el]{'empty_element'})
2378 0 0 if ($tag eq "ol" or $tag eq "ul")
2386 0 0 if ($current_prop->{'display'} eq "block")
2399 0 0 if ($mytext[$first]{'text'} eq "" and $mytext[$first]{'tag'} eq $tag)
2409 0 0 if (@mytext == 2)
2432 0 0 if ($properties[-1]{'font-family'} ne $current_prop->{'font-family'})
2437 0 0 if ($properties[-1]{'font-style'} ne $current_prop->{'font-style'})
2442 0 0 if ($properties[-1]{'font-weight'} ne $current_prop->{'font-weight'})
2458 0 0 if ($newval != $current_prop->{'font-size'})
2465 0 0 if ($call_get_font)
2469 0 0 $current_prop->{'font-style'} eq 'normal' ? :
0 0 $current_prop->{'font-weight'} eq 'normal' ? :
2476 0 0 if ($properties[-1]{'color'} ne $current_prop->{'color'})
2480 0 0 if (defined $grfx and ref($grfx) =~ /^PDF::Builder::Content/)
2516 0 0 if ($botm < $topm)
2561 0 0 if ($need_line)
2563 0 0 if ($para)
2575 0 0 if ($start_y - $add_y - $asc + $desc < $min_y)
2615 0 0 if (defined $grfx and ref($grfx) =~ /^PDF::Builder::Content/) { }
2632 0 0 if ($list_marker ne "")
2639 0 0 if ($list_marker =~ /^\./) { }
0 0 elsif ($list_marker eq '' or $list_marker eq ' ') { }
2644 0 0 if ($list_marker eq '.disc') { }
0 0 elsif ($list_marker eq '.circle') { }
0 0 elsif ($list_marker eq '.square') { }
0 0 elsif ($list_marker eq '.box') { }
2677 0 0 $current_prop->{'font-style'} eq 'normal' ? :
0 0 $current_prop->{'font-weight'} eq 'normal' ? :
2685 0 0 if ($x + $w <= $endx) { }
2691 0 0 if ($current_prop->{'text-decoration'} ne "none")
2704 0 0 if ($phrase =~ /(\s+)$/)
2713 0 0 if ($current_prop->{'text-decoration'} =~ /underline/)
2718 0 0 if ($current_prop->{'text-decoration'} =~ /line-through/)
2724 0 0 if ($current_prop->{'text-decoration'} =~ /overline/)
2754 0 0 if ($current_prop->{'_href'} ne "")
2766 0 0 if ($href =~ /^#/) { }
2769 0 0 if ($href =~ /^#(\d+)$/) { }
0 0 elsif ($href =~ /^#(\d+)-(\d+)-(\d+)$/) { }
0 0 elsif ($href =~ /^#(\d+)-(\d+)-(\d+)-(.+)$/) { }
2785 0 0 if ($zoom <= 0)
2795 0 0 if ($pageno < 1)
2799 0 0 if (defined $xpos and $xpos < 0)
2803 0 0 if (defined $ypos and $ypos < 0)
2809 0 0 unless (defined $tgt_page)
2814 0 0 if (not defined $xpos) { }
2841 0 0 if ($phrase ne "")
2853 0 0 if ($phrase =~ s/(\s+)$//) { }
2864 0 0 if ($full_line and index($word, " ") == -1)
2870 0 0 if ($wordLeft eq "")
2874 0 0 if ($wordLeft eq "")
2888 0 0 if ($phrase =~ s/(\S+)$//)
2897 0 0 if ($mytext[$ptag]{'text'} ne "")
2898 0 0 if ($mytext[$ptag]{'tag'} ne "p")
2903 0 0 if ($phrase eq "" and $remainder ne "")
2920 0 0 if ($phrase eq "")
2937 0 0 if ($phrase ne '') { }
2958 0 0 if ($#mytext == 0) { }
2963 0 0 if ($restore == 0) { }
0 0 elsif ($restore == 1) { }
2967 0 0 if ($properties[-1]{'font-family'} ne $current_prop->{'font-family'})
2972 0 0 if ($properties[-1]{'font-style'} ne $current_prop->{'font-style'})
2977 0 0 if ($properties[-1]{'font-weight'} ne $current_prop->{'font-weight'})
2993 0 0 if ($newval != $current_prop->{'font-size'})
3000 0 0 if ($call_get_font)
3004 0 0 $current_prop->{'font-style'} eq 'normal' ? :
0 0 $current_prop->{'font-weight'} eq 'normal' ? :
3011 0 0 if ($properties[-1]{'color'} ne $current_prop->{'color'})
3015 0 0 if (defined $grfx and ref($grfx) =~ /^PDF::Builder::Content/)
3033 0 0 if ($restore == 0 or $restore == 1) { }
3090 0 0 if (defined $selector)
3091 0 0 if ($selector =~ /^tag:(.+)$/)
3097 0 0 if (defined $selector) { }
3098 0 0 if (defined $source->{$selector})
3103 0 0 if ($_ eq 'text-decoration') { }
3105 0 0 if (defined $target->{$_} and $target->{$_} ne 'none') { }
3117 0 0 if ($tag_sel eq "text" or $tag_sel eq "tag")
3118 0 0 if ($tag_sel eq "cont")
3119 0 0 if ($tag_sel eq "body")
3120 0 0 if (ref $source->{$tag_sel} ne 'HASH') { }
3131 0 0 if (defined $source->{'body'})
3146 0 0 if $leading <= 0
3147 0 0 if $leading < 1
3170 0 0 unless (defined $opts{'rect'})
3179 0 0 if (defined $opts{'relative'})
3181 0 0 if @relative < 2 or @relative > 4
3187 0 0 if (@relative == 3)
3190 0 0 if (@relative == 4)
3213 0 0 if ($draw_outline ne "none" and defined $grfx and ref($grfx) =~ /^PDF::Builder::Content/)
3235 0 0 if ($i == 0) { }
3288 0 0 if ($markup eq 'pre') { }
0 0 elsif ($markup eq 'none') { }
0 0 elsif ($markup eq 'md1') { }
3294 0 0 if (ref $text eq '') { }
0 0 elsif (ref $text eq 'ARRAY') { }
3314 0 0 if (ref $text eq '') { }
0 0 elsif (ref $text eq 'ARRAY') { }
3324 0 0 if (ref $text eq '') { }
0 0 elsif (ref $text eq 'ARRAY') { }
3350 0 0 if ($_ =~ /^\s*$/) { }
3352 0 0 if ($in_para)
3362 0 0 if ($in_para) { }
3377 0 0 if ($in_para)
3397 0 0 unless (defined $rc)
3399 0 0 if ($rc) { }
3429 0 0 if (defined $opts{'substitute'})
3445 0 0 if (defined $opts{'style'})
3454 0 0 unless (defined $rc)
3456 0 0 if ($rc) { }
3468 0 0 if (defined $head and defined $head->{'_content'})
3474 0 0 if ($style_text ne "")
3476 0 0 if (defined $array[$el - 1]{'tag'} and $array[$el - 1]{'tag'} eq "style")
3491 0 0 if ($style_text ne "")
3493 0 0 if (defined $array[$el - 1]{'tag'} and $array[$el - 1]{'tag'} eq "style")
3529 0 0 if ($text =~ s/^\s+//)
3530 0 0 if ($text eq "")
3532 0 0 if ($text =~ s/([^\s]+)//)
3535 0 0 if ($text =~ s/^\s*{//)
3536 0 0 if ($text eq "")
3541 0 0 if ($text =~ s/([^}]+)//)
3544 0 0 if ($text =~ s/^}\s*//)
3545 0 0 if ($text eq "")
3563 0 0 unless (defined $property_name and defined $value)
3570 0 0 if ($value =~ s/^['"]//)
3598 0 0 if ($element =~ /^HTML::Element=HASH/) { }
3612 0 0 if ($tag eq "br" or $tag eq "hr" or $tag eq "img" or $tag eq "area" or $tag eq "base" or $tag eq "col" or $tag eq "embed" or $tag eq "input" or $tag eq "link" or $tag eq "meta" or $tag eq "source" or $tag eq "track" or $tag eq "wbr" or $tag eq "defaults" or $tag eq "style")
3626 0 0 if ($element->{$key} eq "/")
3629 0 0 if ($key =~ /^_/)
3635 0 0 if (not $no_content and defined $element->{'_content'}) { }
3640 0 0 if ($_ =~ /^HTML::Element=HASH/) { }
3653 0 0 unless ($no_content)
3678 0 0 if ($font_size =~ /^(\d+\.?\d*)(.*)$/) { }
0 0 elsif ($font_size =~ /^(\.\d+)(.*)$/) { }
3689 0 0 if ($unit eq '') { }
0 0 elsif ($unit eq 'pt') { }
0 0 elsif ($unit eq '%') { }
3719 0 0 if ($length =~ /^(\d+\.?\d*)(.*)$/) { }
0 0 elsif ($length =~ /^(\.\d+)(.*)$/) { }
3731 0 0 if ($unit eq '') { }
0 0 elsif ($unit eq 'pt') { }
0 0 elsif ($unit eq '%') { }
3764 0 0 unless (defined $suffix)
3765 0 0 unless (defined $prefix)
3768 0 0 if ($type eq 'decimal') { }
0 0 elsif ($type eq 'upper-roman' or $type eq 'lower-roman') { }
0 0 elsif ($type eq 'upper-alpha' or $type eq 'lower-alpha') { }
0 0 elsif ($type eq 'disc') { }
0 0 elsif ($type eq 'circle') { }
0 0 elsif ($type eq 'square') { }
0 0 elsif ($type eq 'box') { }
0 0 elsif ($type eq 'none') { }
0 0 elsif ($type eq '.u') { }
0 0 elsif ($type eq '.o') { }
3772 0 0 if ($value >= 900)
3773 0 0 if ($value >= 500)
3774 0 0 if ($value >= 400)
3776 0 0 if ($value >= 90)
3777 0 0 if ($value >= 50)
3778 0 0 if ($value >= 40)
3780 0 0 if ($value == 9)
3781 0 0 if ($value >= 5)
3782 0 0 if ($value == 4)
3784 0 0 if ($type eq "lower-roman")
3794 0 0 if ($type eq "lower-alpha")
3807 0 0 if ($depth == 1) { }
0 0 elsif ($depth == 2) { }
0 0 elsif ($depth >= 3) { }
3881 0 0 if ($asc > $o_asc) { }
3886 0 0 if ($desc < $o_desc) { }
3891 0 0 if ($desc_leading < $o_desc_leading) { }
3897 0 0 if ($need_revise)
3904 0 0 if ($start_y - $asc + $desc < $min_y) { }
3925 0 0 if ($x > $endx) { }
0 0 elsif ($x + $text_w > $endx) { }
3941 0 0 if ($i == -1)
3969 0 0 if ($i == -1)