Package: libpdf-api2-perl / 2.038-3

outlines.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: outlines() returns wrong object when outlines exist
 The object needs to be blessed into PDF::API2::Outlines
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=121912
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=509706
Author: futuramedium@yandex.ru
Reviewed-by: Damyan Ivanov <dmn@debian.org>
 gregor herrmann <gregoa@debian.org>
Last-Update: 2020-09-04

--- a/lib/PDF/API2.pm
+++ b/lib/PDF/API2.pm
@@ -2395,6 +2395,12 @@
     $self->{'pdf'}->{'Root'}->{'Outlines'} ||= PDF::API2::Outlines->new($self);
 
     my $obj = $self->{'pdf'}->{'Root'}->{'Outlines'};
+    bless $obj, 'PDF::API2::Outlines';
+    $obj->{' apipdf'} = $self->{pdf};
+    $obj->{' api'}    = $self;
+    weaken( $obj->{' apipdf'} );
+    weaken( $obj->{' api'} );
+
 
     $self->{'pdf'}->new_obj($obj) unless $obj->is_obj($self->{'pdf'});
     $self->{'pdf'}->out_obj($obj);