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   951 use v5.26;
  2         6  
4 2     2   8 use Object::Pad;
  2         3  
  2         10  
5 2     2   218 use utf8;
  2         2  
  2         18  
6 2     2   41 use Carp;
  2         3  
  2         385  
7              
8             class SVGPDF::Defs :isa(SVGPDF::Element);
9              
10 1     1 0 2 method process () {
  1         2  
  1         3  
11 1         5 my $atts = $self->atts;
12 1         4 my $xo = $self->xo;
13 1 50       3 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       8 next if ref($_) eq 'SVGPDF::TextElement';
19 1         14 my $id = $_->atts->{id};
20 1 50       3 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         3 $self->_dbg( "-" );
30             }
31              
32              
33             1;