lib/origami/reference.rb in origami-1.2.5 vs lib/origami/reference.rb in origami-1.2.6

- old
+ new

@@ -44,11 +44,11 @@ def initialize(refno, refgen) @refno, @refgen = refno, refgen end - def self.parse(stream) #:nodoc: + def self.parse(stream, parser = nil) #:nodoc: offset = stream.pos if stream.scan(@@regexp).nil? raise InvalidReferenceError, "Bad reference to indirect objet format" @@ -62,24 +62,23 @@ ref end def solve - pdfdoc = self.pdf if pdfdoc.nil? raise InvalidReferenceError, "Not attached to any PDF" end target = pdfdoc.get_object(self) - if target.nil? + if target.nil? and not Origami::OPTIONS[:ignore_bad_references] raise InvalidReferenceError, "Cannot resolve reference : #{self.to_s}" end - target + target or Null.new end def eql?(ref) #:nodoc ref.is_a?(Reference) and ref.refno == @refno and ref.refgen == @refgen end @@ -108,10 +107,10 @@ # def value self end - def real_type ; Reference end + def self.native_type ; Reference end end end