Skip to content

Commit

Permalink
[RT #122371] Remove improperly-placed weaken statements
Browse files Browse the repository at this point in the history
  • Loading branch information
ssimms committed Jul 6, 2017
1 parent 26705e8 commit 106fdb1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{{$NEXT}}

- [RT #122372] Fix weakening when a page is added to the end of a multiple
page document (reported by Phil Perry).
- [RT #122371] Remove a couple of improperly-placed weaken
statements (reported by Phil Perry).

- [RT #122372] Fix weakening when a page is added to the end of a
multiple page document (reported by Phil Perry).

- Fix Bank Gothic core font (reported by Phil Perry).

Expand Down
4 changes: 2 additions & 2 deletions lib/PDF/API2/Basic/PDF/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ sub out_obj {
# in the hash) (which is super-fast).
unless (exists $self->{' outlist_cache'}{$obj}) {
push @{$self->{' outlist'}}, $obj;
weaken $self->{' outlist'}->[-1];
# weaken $self->{' outlist'}->[-1];
$self->{' outlist_cache'}{$obj} = 1;
}
return $obj;
Expand Down Expand Up @@ -1106,7 +1106,7 @@ sub add_obj {

$self->{' objcache'}{$num, $gen} = $obj;
$self->{' objects'}{$obj->uid()} = [$num, $gen];
weaken $self->{' objcache'}{$num, $gen};
# weaken $self->{' objcache'}{$num, $gen};
return $obj;
}

Expand Down
9 changes: 9 additions & 0 deletions t/circular-references.t
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use Test::More;
use Test::Exception;

use strict;
use warnings;
Expand Down Expand Up @@ -29,4 +30,12 @@ $page = $pdf->page(1);
ok(isweak($pdf->{'pagestack'}->[1]),
q{A spliced page is marked as weakened in the page stack});

# Font out of scope

{
$pdf->corefont('Helvetica');
}

lives_ok(sub { $pdf->stringify() }, 'Font added inside a black is still present on save');

done_testing();

0 comments on commit 106fdb1

Please sign in to comment.