File Coverage

blib/lib/SVGPDF/Defs.pm
Criterion Covered Total %
statement 25 27 92.5
branch 4 8 50.0
condition 0 3 0.0
subroutine 5 5 100.0
pod 0 1 0.0
total 34 44 77.2


line stmt bran cond sub pod time code
1             #! perl
2              
3 2     2   1533 use v5.26;
  2         5  
4 2     2   7 use Object::Pad;
  2         3  
  2         11  
5 2     2   202 use utf8;
  2         3  
  2         11  
6 2     2   65 use Carp;
  2         3  
  2         504  
7              
8             class SVGPDF::Defs :isa(SVGPDF::Element);
9              
10 1     1 0 2 method process () {
  1         2  
  1         2  
11 1         5 my $atts = $self->atts;
12 1         25 my $xo = $self->xo;
13 1 50       4 return if $atts->{omit}; # for testing/debugging.
14              
15 1         4 $self->_dbg( "+", $self->name, " ====" );
16              
17 1         5 for ( $self->get_children ) {
18 3 100       7 next if ref($_) eq 'SVGPDF::TextElement';
19 1         3 my $id = $_->atts->{id};
20 1 50       4 unless ( defined($id) ) {
21 0 0 0     0 warn("SVG: Missing id for ", $_->name, " in defs (skipped)\n")
22             if $self->root->verbose && $_->name ne "style";
23 0         0 next;
24             }
25 1         3 $self->_dbg( "defs: \"$id\" (", $_->name, ")" );
26 1         4 $self->root->defs->{ "#$id" } = $_;
27             }
28              
29 1         5 $self->_dbg( "-" );
30             }
31              
32              
33             1;