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   1272 use v5.26;
  2         7  
4 2     2   11 use Object::Pad;
  2         5  
  2         15  
5 2     2   250 use utf8;
  2         4  
  2         13  
6 2     2   94 use Carp;
  2         4  
  2         579  
7              
8             class SVGPDF::Defs :isa(SVGPDF::Element);
9              
10 1     1 0 3 method process () {
  1         3  
  1         2  
11 1         7 my $atts = $self->atts;
12 1         7 my $xo = $self->xo;
13 1 50       5 return if $atts->{omit}; # for testing/debugging.
14              
15 1         4 $self->_dbg( "+", $self->name, " ====" );
16              
17 1         7 for ( $self->get_children ) {
18 3 100       11 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         5 $self->_dbg( "defs: \"$id\" (", $_->name, ")" );
26 1         7 $self->root->defs->{ "#$id" } = $_;
27             }
28              
29 1         7 $self->_dbg( "-" );
30             }
31              
32              
33             1;