| 1 | package PDF::API2::Outline; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use base 'PDF::API2::Basic::PDF::Dict'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 2 | our $VERSION = '2.044'; # VERSION | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use Carp qw(croak); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 2 | ▶ | use PDF::API2::Basic::PDF::Utils; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 2 | ▶ | use Scalar::Util qw(weaken); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | =head1 NAME | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | PDF::API2::Outline - Manage PDF outlines (a.k.a. bookmarks) | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | # Get/create the top-level outline tree | ||||||||||||||||||||||||||||
| 21 | my $outline = $pdf->outline(); | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | # Add an entry | ||||||||||||||||||||||||||||
| 24 | my $item = $outline->outline(); | ||||||||||||||||||||||||||||
| 25 | $item->title('First Page'); | ||||||||||||||||||||||||||||
| 26 | $item->destination($pdf->open_page(1)); | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | =head1 METHODS | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | =cut | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | sub new { | ||||||||||||||||||||||||||||
| 33 | 17 | ▶ | my ($class, $api, $parent, $prev) = @_; | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 34 | 17 | my $self = $class->SUPER::new(); | |||||||||||||||||||||||||||
| 35 | 17 | ▶ | $self->{'Parent'} = $parent if defined $parent; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 36 | 17 | ▶ | $self->{'Prev'} = $prev if defined $prev; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 37 | 17 | $self->{' api'} = $api; | |||||||||||||||||||||||||||
| 38 | 17 | weaken $self->{' api'}; | |||||||||||||||||||||||||||
| 39 | 17 | weaken $self->{'Parent'}; | |||||||||||||||||||||||||||
| 40 | 17 | return $self; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | =head2 Examine the Outline Tree | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | =head3 has_children | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | my $boolean = $outline->has_children(); | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | Return true if the current outline item has child items. | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | =cut | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | sub has_children { | ||||||||||||||||||||||||||||
| 54 | 67 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
has_children: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | # Opened by PDF::API2 | ||||||||||||||||||||||||||||
| 57 | 67 | ▶ | return 1 if exists $self->{'First'}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | # Created by PDF::API2 | ||||||||||||||||||||||||||||
| 60 | 54 | ▶ | return @{$self->{' children'}} > 0 if exists $self->{' children'}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 36 | return; | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | =head3 count | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | my $integer = $outline->count(); | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | Return the number of descendants that are visible when the current outline item | ||||||||||||||||||||||||||||
| 70 | is open (expanded). | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | =cut | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | sub count { | ||||||||||||||||||||||||||||
| 75 | 26 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
count: called CC=8 SCAR=20.8
Pod
documented
| |||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | # Set count to the number of descendant items that will be visible when the | ||||||||||||||||||||||||||||
| 78 | # current item is open. | ||||||||||||||||||||||||||||
| 79 | 26 | my $count = 0; | |||||||||||||||||||||||||||
| 80 | 26 | ▶ | if ($self->has_children()) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 81 | 20 | ▶ | $self->_load_children() unless exists $self->{' children'}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 82 | 20 | $count += @{$self->{' children'}}; | |||||||||||||||||||||||||||
| 83 | 20 | foreach my $child (@{$self->{' children'}}) { | |||||||||||||||||||||||||||
| 84 | 39 | ▶ | next unless $child->has_children(); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 85 | 10 | ▶ | next unless $child->is_open(); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 86 | 6 | $count += $child->count(); | |||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | 26 | ▶ | if ($count) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 91 | 20 | ▶ | $self->{'Count'} = PDFNum($self->is_open() ? $count : -$count); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | 26 | return $count; | |||||||||||||||||||||||||||
| 95 | } | ||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | sub _load_children { | ||||||||||||||||||||||||||||
| 98 | 2 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
_load_children: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 99 | 2 | my $item = $self->{'First'}; | |||||||||||||||||||||||||||
| 100 | 2 | ▶ | return unless $item; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 101 | 2 | $item->realise(); | |||||||||||||||||||||||||||
| 102 | 2 | bless $item, __PACKAGE__; | |||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | 2 | push @{$self->{' children'}}, $item; | |||||||||||||||||||||||||||
| 105 | 2 | ▶ | while ($item->next()) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 106 | 2 | $item = $item->next(); | |||||||||||||||||||||||||||
| 107 | 2 | $item->realise(); | |||||||||||||||||||||||||||
| 108 | 2 | bless $item, __PACKAGE__; | |||||||||||||||||||||||||||
| 109 | 2 | push @{$self->{' children'}}, $item; | |||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||
| 111 | 2 | return $self; | |||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||
| 114 | =head3 first | ||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||
| 116 | my $child = $outline->first(); | ||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||
| 118 | Return the first child of the current outline level, if one exists. | ||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||
| 120 | =cut | ||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||
| 122 | sub first { | ||||||||||||||||||||||||||||
| 123 | 19 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
first: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 124 | 19 | ▶ | if (defined $self->{' children'} and defined $self->{' children'}->[0]) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $self->{" children"} and defined $self->{" children"}[0]
MC/DC50%1/2
defined $self->{" children"} and defined $self->{" children"}[0]
defined $self->{" children"}
defined $self->{" children"}[0]
Truth table66%2/3
A and B
A= defined $self->{" children"}B= defined $self->{" children"}[0]
| |||||||||||||||||||||||||||||
| 125 | 14 | $self->{'First'} = $self->{' children'}->[0]; | |||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||
| 127 | 19 | return $self->{'First'}; | |||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||
| 130 | =head3 last | ||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||
| 132 | my $child = $outline->last(); | ||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||
| 134 | Return the last child of the current outline level, if one exists. | ||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||
| 136 | =cut | ||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||
| 138 | sub last { | ||||||||||||||||||||||||||||
| 139 | 11 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
last: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 140 | 11 | ▶ | if (defined $self->{' children'} and defined $self->{' children'}->[-1]) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $self->{" children"} and defined $self->{" children"}[-1]
MC/DC50%1/2
defined $self->{" children"} and defined $self->{" children"}[-1]
defined $self->{" children"}
defined $self->{" children"}[-1]
Truth table66%2/3
A and B
A= defined $self->{" children"}B= defined $self->{" children"}[-1]
| |||||||||||||||||||||||||||||
| 141 | 6 | $self->{'Last'} = $self->{' children'}->[-1]; | |||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||
| 143 | 11 | return $self->{'Last'}; | |||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||
| 146 | =head3 parent | ||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||
| 148 | my $parent = $outline->parent(); | ||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||
| 150 | Return the parent of the current item, if not at the top level of the outline | ||||||||||||||||||||||||||||
| 151 | tree. | ||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||
| 153 | =cut | ||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||
| 155 | sub parent { | ||||||||||||||||||||||||||||
| 156 | 11 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
parent: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||||||||||
| 157 | 11 | ▶ | $self->{'Parent'} = shift() if defined $_[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 158 | 11 | return $self->{'Parent'}; | |||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||
| 161 | =head3 prev | ||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | my $sibling = $outline->prev(); | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | Return the previous item of the current level of the outline tree. | ||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||
| 167 | =cut | ||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||
| 169 | sub prev { | ||||||||||||||||||||||||||||
| 170 | 25 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
prev: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 171 | 25 | ▶ | $self->{'Prev'} = shift() if defined $_[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 172 | 25 | return $self->{'Prev'}; | |||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||
| 175 | =head3 next | ||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||
| 177 | my $sibling = $outline->next(); | ||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||
| 179 | Return the next item of the current level of the outline tree. | ||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||
| 181 | =cut | ||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||
| 183 | sub next { | ||||||||||||||||||||||||||||
| 184 | 67 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
next: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 185 | 67 | ▶ | $self->{'Next'} = shift() if defined $_[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 186 | 67 | return $self->{'Next'}; | |||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||
| 189 | =head2 Modify the Outline Tree | ||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||
| 191 | =head3 outline | ||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||
| 193 | my $child = $outline->outline(); | ||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||
| 195 | Add an outline item at the end of the current outline's list of children. | ||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||
| 197 | =cut | ||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||
| 199 | sub outline { | ||||||||||||||||||||||||||||
| 200 | 10 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
outline: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||
| 202 | 10 | my $child = PDF::API2::Outline->new($self->{' api'}, $self); | |||||||||||||||||||||||||||
| 203 | 10 | ▶ | $self->{' children'} //= []; | ||||||||||||||||||||||||||
|
Condition100%2/2
$self->{" children"} //= []
MC/DC100%1/1
$self->{" children"} //= []
$self->{" children"}
Truth table100%2/2
A
A= $self->{" children"}
| |||||||||||||||||||||||||||||
| 204 | 10 | ▶ | $child->prev($self->{' children'}->[-1]) if @{$self->{' children'}}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 205 | 10 | ▶ | $self->{' children'}->[-1]->next($child) if @{$self->{' children'}}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 206 | 10 | push @{$self->{' children'}}, $child; | |||||||||||||||||||||||||||
| 207 | 10 | ▶ | unless ($child->is_obj($self->{' api'}->{'pdf'})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 208 | 10 | $self->{' api'}->{'pdf'}->new_obj($child); | |||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||
| 211 | 10 | return $child; | |||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||
| 214 | =head3 insert_after | ||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||
| 216 | my $sibling = $outline->insert_after(); | ||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||
| 218 | Add an outline item immediately following the current item. | ||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||
| 220 | =cut | ||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||
| 222 | sub insert_after { | ||||||||||||||||||||||||||||
| 223 | 2 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
insert_after: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||
| 225 | 2 | my $sibling = PDF::API2::Outline->new($self->{' api'}, $self->parent()); | |||||||||||||||||||||||||||
| 226 | 2 | $sibling->next($self->next()); | |||||||||||||||||||||||||||
| 227 | 2 | ▶ | $self->next->prev($sibling) if $self->next(); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 228 | 2 | $self->next($sibling); | |||||||||||||||||||||||||||
| 229 | 2 | $sibling->prev($self); | |||||||||||||||||||||||||||
| 230 | 2 | ▶ | unless ($sibling->is_obj($self->{' api'}->{'pdf'})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 231 | 2 | $self->{' api'}->{'pdf'}->new_obj($sibling); | |||||||||||||||||||||||||||
| 232 | } | ||||||||||||||||||||||||||||
| 233 | 2 | $self->parent->_reset_children(); | |||||||||||||||||||||||||||
| 234 | 2 | return $sibling; | |||||||||||||||||||||||||||
| 235 | } | ||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||
| 237 | =head3 insert_before | ||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||
| 239 | $sibling = $outline->insert_before(); | ||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||
| 241 | Add an outline item immediately preceding the current item. | ||||||||||||||||||||||||||||
| 242 | |||||||||||||||||||||||||||||
| 243 | =cut | ||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||
| 245 | sub insert_before { | ||||||||||||||||||||||||||||
| 246 | 2 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
insert_before: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||
| 248 | 2 | my $sibling = PDF::API2::Outline->new($self->{' api'}, $self->parent()); | |||||||||||||||||||||||||||
| 249 | 2 | $sibling->prev($self->prev()); | |||||||||||||||||||||||||||
| 250 | 2 | ▶ | $self->prev->next($sibling) if $self->prev(); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 251 | 2 | $self->prev($sibling); | |||||||||||||||||||||||||||
| 252 | 2 | $sibling->next($self); | |||||||||||||||||||||||||||
| 253 | 2 | ▶ | unless ($sibling->is_obj($self->{' api'}->{'pdf'})) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 254 | 2 | $self->{' api'}->{'pdf'}->new_obj($sibling); | |||||||||||||||||||||||||||
| 255 | } | ||||||||||||||||||||||||||||
| 256 | 2 | $self->parent->_reset_children(); | |||||||||||||||||||||||||||
| 257 | 2 | return $sibling; | |||||||||||||||||||||||||||
| 258 | } | ||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||
| 260 | sub _reset_children { | ||||||||||||||||||||||||||||
| 261 | 4 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
_reset_children: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 262 | 4 | my $item = $self->first(); | |||||||||||||||||||||||||||
| 263 | 4 | $self->{' children'} = []; | |||||||||||||||||||||||||||
| 264 | 4 | ▶ | return unless $item; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||
| 266 | 4 | push @{$self->{' children'}}, $item; | |||||||||||||||||||||||||||
| 267 | 4 | ▶ | while ($item->next()) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 268 | 16 | $item = $item->next(); | |||||||||||||||||||||||||||
| 269 | 16 | push @{$self->{' children'}}, $item; | |||||||||||||||||||||||||||
| 270 | } | ||||||||||||||||||||||||||||
| 271 | 4 | return $self; | |||||||||||||||||||||||||||
| 272 | } | ||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||
| 274 | =head3 delete | ||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||
| 276 | $outline->delete(); | ||||||||||||||||||||||||||||
| 277 | |||||||||||||||||||||||||||||
| 278 | Remove the current outline item from the outline tree. If the item has any | ||||||||||||||||||||||||||||
| 279 | children, they will effectively be deleted as well since they will no longer be | ||||||||||||||||||||||||||||
| 280 | linked. | ||||||||||||||||||||||||||||
| 281 | |||||||||||||||||||||||||||||
| 282 | =cut | ||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||
| 284 | sub delete { | ||||||||||||||||||||||||||||
| 285 | 1 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
delete: called CC=4 SCAR=14.1
Pod
documented
| |||||||||||||||||||||||||||||
| 286 | |||||||||||||||||||||||||||||
| 287 | 1 | my $prev = $self->prev(); | |||||||||||||||||||||||||||
| 288 | 1 | my $next = $self->next(); | |||||||||||||||||||||||||||
| 289 | 1 | ▶ | $prev->next($next) if defined $prev; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 290 | 1 | ▶ | $next->prev($prev) if defined $next; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||
| 292 | 1 | my $siblings = $self->parent->{' children'}; | |||||||||||||||||||||||||||
| 293 | 1 | @$siblings = grep { $_ ne $self } @$siblings; | |||||||||||||||||||||||||||
| 294 | 1 | ▶ | delete $self->parent->{' children'} unless $self->parent->has_children(); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||
| 296 | 1 | return; | |||||||||||||||||||||||||||
| 297 | } | ||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||
| 299 | =head3 is_open | ||||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||
| 301 | # Get | ||||||||||||||||||||||||||||
| 302 | my $boolean = $outline->is_open(); | ||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||
| 304 | # Set | ||||||||||||||||||||||||||||
| 305 | my $outline = $outline->is_open($boolean); | ||||||||||||||||||||||||||||
| 306 | |||||||||||||||||||||||||||||
| 307 | Get/set whether the outline is expanded or collapsed. | ||||||||||||||||||||||||||||
| 308 | |||||||||||||||||||||||||||||
| 309 | =cut | ||||||||||||||||||||||||||||
| 310 | |||||||||||||||||||||||||||||
| 311 | sub is_open { | ||||||||||||||||||||||||||||
| 312 | 33 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
is_open: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||
| 313 | |||||||||||||||||||||||||||||
| 314 | # Get | ||||||||||||||||||||||||||||
| 315 | 33 | ▶ | unless (@_) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 316 | # Created by PDF::API2 | ||||||||||||||||||||||||||||
| 317 | 32 | ▶ | return $self->{' closed'} ? 0 : 1 if exists $self->{' closed'}; | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||
| 319 | # Opened by PDF::API2 | ||||||||||||||||||||||||||||
| 320 | 26 | ▶ | return $self->{'Count'}->val() > 0 if exists $self->{'Count'}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||
| 322 | # Default | ||||||||||||||||||||||||||||
| 323 | 7 | return 1; | |||||||||||||||||||||||||||
| 324 | } | ||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||
| 326 | # Set | ||||||||||||||||||||||||||||
| 327 | 1 | my $is_open = shift(); | |||||||||||||||||||||||||||
| 328 | 1 | $self->{' closed'} = (not $is_open); | |||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||
| 330 | 1 | return $self; | |||||||||||||||||||||||||||
| 331 | } | ||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||
| 333 | # Deprecated | ||||||||||||||||||||||||||||
| 334 | sub open { | ||||||||||||||||||||||||||||
| 335 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
open: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 336 | 0 | return $self->is_open(1); | |||||||||||||||||||||||||||
| 337 | } | ||||||||||||||||||||||||||||
| 338 | |||||||||||||||||||||||||||||
| 339 | # Deprecated | ||||||||||||||||||||||||||||
| 340 | sub closed { | ||||||||||||||||||||||||||||
| 341 | 0 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
closed: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 342 | 0 | return $self->is_open(0); | |||||||||||||||||||||||||||
| 343 | } | ||||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||
| 345 | =head2 Set Outline Attributes | ||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||
| 347 | =head3 title | ||||||||||||||||||||||||||||
| 348 | |||||||||||||||||||||||||||||
| 349 | # Get | ||||||||||||||||||||||||||||
| 350 | my $title = $outline->title(); | ||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||
| 352 | # Set | ||||||||||||||||||||||||||||
| 353 | $outline = $outline->title($text); | ||||||||||||||||||||||||||||
| 354 | |||||||||||||||||||||||||||||
| 355 | Get/set the title of the outline item. | ||||||||||||||||||||||||||||
| 356 | |||||||||||||||||||||||||||||
| 357 | =cut | ||||||||||||||||||||||||||||
| 358 | |||||||||||||||||||||||||||||
| 359 | sub title { | ||||||||||||||||||||||||||||
| 360 | 4 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
title: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 361 | |||||||||||||||||||||||||||||
| 362 | # Get | ||||||||||||||||||||||||||||
| 363 | 4 | ▶ | unless (@_) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 364 | 1 | ▶ | return unless $self->{'Title'}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 365 | 1 | return $self->{'Title'}->val(); | |||||||||||||||||||||||||||
| 366 | } | ||||||||||||||||||||||||||||
| 367 | |||||||||||||||||||||||||||||
| 368 | # Set | ||||||||||||||||||||||||||||
| 369 | 3 | my $text = shift(); | |||||||||||||||||||||||||||
| 370 | 3 | $self->{'Title'} = PDFStr($text); | |||||||||||||||||||||||||||
| 371 | 3 | return $self; | |||||||||||||||||||||||||||
| 372 | } | ||||||||||||||||||||||||||||
| 373 | |||||||||||||||||||||||||||||
| 374 | =head3 destination | ||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||
| 376 | $outline = $outline->destination($destination, $location, @args); | ||||||||||||||||||||||||||||
| 377 | |||||||||||||||||||||||||||||
| 378 | Set the destination page and optional position of the outline. C<$location> and | ||||||||||||||||||||||||||||
| 379 | C<@args> are as defined in L<PDF::API2::NamedDestination/"destination">. | ||||||||||||||||||||||||||||
| 380 | |||||||||||||||||||||||||||||
| 381 | C<$destination> can optionally be the name of a named destination defined | ||||||||||||||||||||||||||||
| 382 | elsewhere. | ||||||||||||||||||||||||||||
| 383 | |||||||||||||||||||||||||||||
| 384 | =cut | ||||||||||||||||||||||||||||
| 385 | |||||||||||||||||||||||||||||
| 386 | sub _destination { | ||||||||||||||||||||||||||||
| 387 | 2 | ▶ | require PDF::API2::NamedDestination; | ||||||||||||||||||||||||||
|
Subroutine
_destination: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 388 | 2 | return PDF::API2::NamedDestination::_destination(@_); | |||||||||||||||||||||||||||
| 389 | } | ||||||||||||||||||||||||||||
| 390 | |||||||||||||||||||||||||||||
| 391 | sub destination { | ||||||||||||||||||||||||||||
| 392 | 2 | ▶ | my ($self, $destination, $location, @args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
destination: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||||||||||
| 393 | |||||||||||||||||||||||||||||
| 394 | # Remove an existing action dictionary | ||||||||||||||||||||||||||||
| 395 | 2 | delete $self->{'A'}; | |||||||||||||||||||||||||||
| 396 | |||||||||||||||||||||||||||||
| 397 | 2 | ▶ | if (ref($destination)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 398 | # Page Destination | ||||||||||||||||||||||||||||
| 399 | 2 | $self->{'Dest'} = _destination($destination, $location, @args); | |||||||||||||||||||||||||||
| 400 | } | ||||||||||||||||||||||||||||
| 401 | else { | ||||||||||||||||||||||||||||
| 402 | # Named Destination | ||||||||||||||||||||||||||||
| 403 | 0 | $self->{'Dest'} = PDFStr($destination); | |||||||||||||||||||||||||||
| 404 | } | ||||||||||||||||||||||||||||
| 405 | |||||||||||||||||||||||||||||
| 406 | 2 | return $self; | |||||||||||||||||||||||||||
| 407 | } | ||||||||||||||||||||||||||||
| 408 | |||||||||||||||||||||||||||||
| 409 | # Deprecated: Use destination with the indicated changes | ||||||||||||||||||||||||||||
| 410 | sub dest { | ||||||||||||||||||||||||||||
| 411 | 2 | ▶ | my ($self, $destination, $location, @args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
dest: called CC=7 SCAR=27.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 412 | |||||||||||||||||||||||||||||
| 413 | # Replace -fit => 1 or -fitb => 1 with just the location | ||||||||||||||||||||||||||||
| 414 | 2 | ▶ | if (defined $location) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 415 | 0 | ▶ | @args = () if $location eq '-fit' or $location eq '-fitb'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$location eq "-fit" or $location eq "-fitb"
MC/DC0%0/2
$location eq "-fit" or $location eq "-fitb"
$location eq "-fit"
$location eq "-fitb"
Truth table0%0/3
A or B
A= $location eq "-fit"B= $location eq "-fitb"
| |||||||||||||||||||||||||||||
| 416 | } | ||||||||||||||||||||||||||||
| 417 | |||||||||||||||||||||||||||||
| 418 | # Convert args from arrayref to array | ||||||||||||||||||||||||||||
| 419 | 2 | ▶ | @args = @{$args[0]} if @args and ref($args[0]) eq 'ARRAY'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
@args and ref $args[0] eq "ARRAY"
MC/DC0%0/2
@args and ref $args[0] eq "ARRAY"
@args
ref $args[0] eq "ARRAY"
Truth table33%1/3
A and B
A= @argsB= ref $args[0] eq "ARRAY"
| |||||||||||||||||||||||||||||
| 420 | |||||||||||||||||||||||||||||
| 421 | # Remove hyphen prefix from location | ||||||||||||||||||||||||||||
| 422 | 2 | ▶ | $location =~ s/^-// if defined $location; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 423 | |||||||||||||||||||||||||||||
| 424 | 2 | return $self->destination($destination, $location, @args); | |||||||||||||||||||||||||||
| 425 | } | ||||||||||||||||||||||||||||
| 426 | |||||||||||||||||||||||||||||
| 427 | =head3 uri | ||||||||||||||||||||||||||||
| 428 | |||||||||||||||||||||||||||||
| 429 | $outline = $outline->uri($uri); | ||||||||||||||||||||||||||||
| 430 | |||||||||||||||||||||||||||||
| 431 | Launch a URI -- typically a web page -- when the outline item is activated. | ||||||||||||||||||||||||||||
| 432 | |||||||||||||||||||||||||||||
| 433 | =cut | ||||||||||||||||||||||||||||
| 434 | |||||||||||||||||||||||||||||
| 435 | # Deprecated (renamed) | ||||||||||||||||||||||||||||
| 436 | 0 | ▶ | sub url { return uri(@_) } | ||||||||||||||||||||||||||
|
Subroutine
url: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 437 | |||||||||||||||||||||||||||||
| 438 | sub uri { | ||||||||||||||||||||||||||||
| 439 | 0 | ▶ | my ($self, $uri) = @_; | ||||||||||||||||||||||||||
|
Subroutine
uri: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 440 | 0 | delete $self->{'Dest'}; | |||||||||||||||||||||||||||
| 441 | |||||||||||||||||||||||||||||
| 442 | 0 | $self->{'A'} = PDFDict(); | |||||||||||||||||||||||||||
| 443 | 0 | $self->{'A'}->{'S'} = PDFName('URI'); | |||||||||||||||||||||||||||
| 444 | 0 | $self->{'A'}->{'URI'} = PDFStr($uri); | |||||||||||||||||||||||||||
| 445 | |||||||||||||||||||||||||||||
| 446 | 0 | return $self; | |||||||||||||||||||||||||||
| 447 | } | ||||||||||||||||||||||||||||
| 448 | |||||||||||||||||||||||||||||
| 449 | =head3 launch | ||||||||||||||||||||||||||||
| 450 | |||||||||||||||||||||||||||||
| 451 | $outline->launch($file); | ||||||||||||||||||||||||||||
| 452 | |||||||||||||||||||||||||||||
| 453 | Launch an application or file when the outline item is activated. | ||||||||||||||||||||||||||||
| 454 | |||||||||||||||||||||||||||||
| 455 | =cut | ||||||||||||||||||||||||||||
| 456 | |||||||||||||||||||||||||||||
| 457 | # Deprecated (renamed) | ||||||||||||||||||||||||||||
| 458 | 0 | ▶ | sub file { return launch(@_) } | ||||||||||||||||||||||||||
|
Subroutine
file: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 459 | |||||||||||||||||||||||||||||
| 460 | sub launch { | ||||||||||||||||||||||||||||
| 461 | 0 | ▶ | my ($self, $file) = @_; | ||||||||||||||||||||||||||
|
Subroutine
launch: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 462 | 0 | delete $self->{'Dest'}; | |||||||||||||||||||||||||||
| 463 | |||||||||||||||||||||||||||||
| 464 | 0 | $self->{'A'} = PDFDict(); | |||||||||||||||||||||||||||
| 465 | 0 | $self->{'A'}->{'S'} = PDFName('Launch'); | |||||||||||||||||||||||||||
| 466 | 0 | $self->{'A'}->{'F'} = PDFStr($file); | |||||||||||||||||||||||||||
| 467 | |||||||||||||||||||||||||||||
| 468 | 0 | return $self; | |||||||||||||||||||||||||||
| 469 | } | ||||||||||||||||||||||||||||
| 470 | |||||||||||||||||||||||||||||
| 471 | =head3 pdf | ||||||||||||||||||||||||||||
| 472 | |||||||||||||||||||||||||||||
| 473 | $outline = $outline->pdf($filename, $page_number, $location, @args); | ||||||||||||||||||||||||||||
| 474 | |||||||||||||||||||||||||||||
| 475 | Open another PDF file to a particular page number (first page is zero, which is | ||||||||||||||||||||||||||||
| 476 | also the default). The page can optionally be positioned at a particular | ||||||||||||||||||||||||||||
| 477 | location if C<$location> and C<@args> are set -- see | ||||||||||||||||||||||||||||
| 478 | L<PDF::API2::NamedDestination/"destination"> for possible settings. | ||||||||||||||||||||||||||||
| 479 | |||||||||||||||||||||||||||||
| 480 | =cut | ||||||||||||||||||||||||||||
| 481 | |||||||||||||||||||||||||||||
| 482 | # Deprecated (renamed) | ||||||||||||||||||||||||||||
| 483 | 0 | ▶ | sub pdfile { return pdf_file(@_) } | ||||||||||||||||||||||||||
|
Subroutine
pdfile: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 484 | |||||||||||||||||||||||||||||
| 485 | # Deprecated; use pdf instead, with the indicated changes | ||||||||||||||||||||||||||||
| 486 | sub pdf_file { | ||||||||||||||||||||||||||||
| 487 | 0 | ▶ | my ($self, $file, $page_number, $location, @args); | ||||||||||||||||||||||||||
|
Subroutine
pdf_file: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 488 | |||||||||||||||||||||||||||||
| 489 | # Replace -fit => 1 or -fitb => 1 with just the location | ||||||||||||||||||||||||||||
| 490 | 0 | ▶ | if (defined $location) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 491 | 0 | ▶ | @args = () if $location eq '-fit' or $location eq '-fitb'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$location eq "-fit" or $location eq "-fitb"
MC/DC0%0/2
$location eq "-fit" or $location eq "-fitb"
$location eq "-fit"
$location eq "-fitb"
Truth table0%0/3
A or B
A= $location eq "-fit"B= $location eq "-fitb"
| |||||||||||||||||||||||||||||
| 492 | } | ||||||||||||||||||||||||||||
| 493 | |||||||||||||||||||||||||||||
| 494 | # Convert args from arrayref to array | ||||||||||||||||||||||||||||
| 495 | 0 | ▶ | @args = @{$args[0]} if @args and ref($args[0]) eq 'ARRAY'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@args and ref $args[0] eq "ARRAY"
MC/DC0%0/2
@args and ref $args[0] eq "ARRAY"
@args
ref $args[0] eq "ARRAY"
Truth table0%0/3
A and B
A= @argsB= ref $args[0] eq "ARRAY"
| |||||||||||||||||||||||||||||
| 496 | |||||||||||||||||||||||||||||
| 497 | # Remove hyphen prefix from location | ||||||||||||||||||||||||||||
| 498 | 0 | ▶ | $location =~ s/^-// if defined $location; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 499 | |||||||||||||||||||||||||||||
| 500 | 0 | return $self->pdf($file, $page_number, $location, @args); | |||||||||||||||||||||||||||
| 501 | } | ||||||||||||||||||||||||||||
| 502 | |||||||||||||||||||||||||||||
| 503 | sub pdf { | ||||||||||||||||||||||||||||
| 504 | 0 | ▶ | my ($self, $file, $page_number, $location, @args) = @_; | ||||||||||||||||||||||||||
|
Subroutine
pdf: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 505 | 0 | ▶ | $page_number //= 0; | ||||||||||||||||||||||||||
|
Condition0%0/2
$page_number //= 0
MC/DC0%0/1
$page_number //= 0
$page_number
Truth table0%0/2
A
A= $page_number
| |||||||||||||||||||||||||||||
| 506 | 0 | delete $self->{'Dest'}; | |||||||||||||||||||||||||||
| 507 | |||||||||||||||||||||||||||||
| 508 | 0 | $self->{'A'} = PDFDict(); | |||||||||||||||||||||||||||
| 509 | 0 | $self->{'A'}->{'S'} = PDFName('GoToR'); | |||||||||||||||||||||||||||
| 510 | 0 | $self->{'A'}->{'F'} = PDFStr($file); | |||||||||||||||||||||||||||
| 511 | |||||||||||||||||||||||||||||
| 512 | 0 | $self->{'A'}->{'D'} = _destination(PDFNum($page_number), $location, @args); | |||||||||||||||||||||||||||
| 513 | |||||||||||||||||||||||||||||
| 514 | 0 | return $self; | |||||||||||||||||||||||||||
| 515 | } | ||||||||||||||||||||||||||||
| 516 | |||||||||||||||||||||||||||||
| 517 | sub fix_outline { | ||||||||||||||||||||||||||||
| 518 | 9 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
fix_outline: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 519 | 9 | $self->first(); | |||||||||||||||||||||||||||
| 520 | 9 | $self->last(); | |||||||||||||||||||||||||||
| 521 | 9 | $self->count(); | |||||||||||||||||||||||||||
| 522 | } | ||||||||||||||||||||||||||||
| 523 | |||||||||||||||||||||||||||||
| 524 | sub outobjdeep { | ||||||||||||||||||||||||||||
| 525 | 9 | ▶ | my $self = shift(); | ||||||||||||||||||||||||||
|
Subroutine
outobjdeep: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 526 | 9 | $self->fix_outline(); | |||||||||||||||||||||||||||
| 527 | 9 | return $self->SUPER::outobjdeep(@_); | |||||||||||||||||||||||||||
| 528 | } | ||||||||||||||||||||||||||||
| 529 | |||||||||||||||||||||||||||||
| 530 | 2 | 1; | |||||||||||||||||||||||||||