Skip to content

Commit

Permalink
xreftable: method XRef#free!
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Delugré committed Jan 20, 2019
1 parent 975a9a6 commit 16e29bb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/origami/xreftable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ def free?
@state == FREE
end

#
# Marks an XRef as freed.
#
def free!
@state = FREE
end

#
# Outputs self into PDF code.
#
Expand Down Expand Up @@ -146,15 +153,15 @@ def self.parse(stream) #:nodoc:
scanner = Parser.init_scanner(stream)

if scanner.scan(@@regexp).nil?
raise InvalidXRefSubsectionError, "Bad subsection format"
raise InvalidXRefSubsectionError, "Bad subsection format"
end

start = scanner['start'].to_i
size = scanner['size'].to_i

xrefs = []
size.times do
xrefs << XRef.parse(scanner)
xrefs << XRef.parse(scanner)
end

XRef::Subsection.new(start, xrefs)
Expand Down Expand Up @@ -220,7 +227,7 @@ class InvalidXRefSectionError < Error #:nodoc:

#
# Class representing a Cross-reference table.
# A section contains a set of XRefSubsection.
# A section contains a set of XRef::Subsection.
#
class Section
include Enumerable
Expand Down

0 comments on commit 16e29bb

Please sign in to comment.