File: outlines.patch

package info (click to toggle)
libpdf-api2-perl 2.033-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 20,140 kB
  • ctags: 947
  • sloc: perl: 41,171; makefile: 10
file content (22 lines) | stat: -rw-r--r-- 831 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Description: outlines() returns wrong object when outlines exist
 The object needs to be blessed into PDF::API2::Outlines
Author: futuramedium@yandex.ru
Acked-By: Damyan Ivanov <dmn@debian.org>
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=121912
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=509706

--- a/lib/PDF/API2.pm
+++ b/lib/PDF/API2.pm
@@ -2353,6 +2353,12 @@ sub outlines {
     $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);