lib/prawn/core/reference.rb in prawn-1.0.0.rc1 vs lib/prawn/core/reference.rb in prawn-1.0.0.rc2
- old
+ new
@@ -32,21 +32,23 @@
output << "endobj\n"
end
def <<(data)
raise 'Cannot add data to a stream that is compressed' if @compressed
- (@stream ||= "") << data
+ (@stream ||= "") << data
+ @data[:Length] = @stream.length
+ @stream
end
def to_s
"#{@identifier} #{gen} R"
end
def compress_stream
@stream = Zlib::Deflate.deflate(@stream)
@data[:Filter] = :FlateDecode
- @data[:Length] ||= @stream.length
+ @data[:Length] = @stream.length
@compressed = true
end
def compressed?
@compressed
@@ -98,9 +100,11 @@
[]
when Hash
obj.values.map{|v| [v] + referenced_objects(v) }
when Array
obj.map{|v| [v] + referenced_objects(v) }
+ when OutlineRoot, OutlineItem
+ referenced_objects(obj.to_hash)
else []
end.flatten.grep(self.class)
end
end