Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: writer.rb
- ===================================================================
- --- writer.rb (revision 202)
- +++ writer.rb (working copy)
- @@ -430,13 +430,13 @@
- # Sets the document to compressed (+true+) or uncompressed (+false+).
- # Defaults to uncompressed. This can ONLY be set once and should be set
- # as early as possible in the document creation process.
- - attr_accessor :compressed
- + attr_reader :compressed
- def compressed=(cc) #:nodoc:
- @compressed = cc if @compressed.nil?
- end
- # Returns +true+ if the document is compressed.
- def compressed?
- - @compressed == true
- + defined?(@compressed) and @compressed == true
- end
- # The set of known labelled destinations. All destinations are of class
- # PDF::Writer::Object::Destination. This is of little interest to
- @@ -467,53 +467,43 @@
- attr_reader :page_height
- # The absolute x position of the left margin.
- - attr_reader :absolute_left_margin
- def absolute_left_margin #:nodoc:
- @left_margin
- end
- # The absolute x position of the right margin.
- - attr_reader :absolute_right_margin
- def absolute_right_margin #:nodoc:
- @page_width - @right_margin
- end
- # Returns the absolute y position of the top margin.
- - attr_reader :absolute_top_margin
- def absolute_top_margin #:nodoc:
- @page_height - @top_margin
- end
- # Returns the absolute y position of the bottom margin.
- - attr_reader :absolute_bottom_margin
- def absolute_bottom_margin #:nodoc:
- @bottom_margin
- end
- # The height of the margin area.
- - attr_reader :margin_height
- def margin_height #:nodoc:
- absolute_top_margin - absolute_bottom_margin
- end
- # The width of the margin area.
- - attr_reader :margin_width
- def margin_width #:nodoc:
- absolute_right_margin - absolute_left_margin
- end
- # The absolute x middle position.
- - attr_reader :absolute_x_middle
- def absolute_x_middle #:nodoc:
- @page_width / 2.0
- end
- # The absolute y middle position.
- - attr_reader :absolute_y_middle
- def absolute_y_middle #:nodoc:
- @page_height / 2.0
- end
- # The middle of the writing area between the left and right margins.
- - attr_reader :margin_x_middle
- def margin_x_middle #:nodoc:
- (absolute_right_margin + absolute_left_margin) / 2.0
- end
- # The middle of the writing area between the top and bottom margins.
- - attr_reader :margin_y_middle
- def margin_y_middle #:nodoc:
- (absolute_top_margin + absolute_bottom_margin) / 2.0
- end
- @@ -522,7 +512,7 @@
- # constrained between the top and bottom margins. Any attempt to set it
- # outside of those margins will cause the y pointer to be placed
- # absolutely at the margins.
- - attr_accessor :y
- + attr_reader :y
- def y=(yy) #:nodoc:
- @y = yy
- @y = absolute_top_margin if @y > absolute_top_margin
- @@ -531,7 +521,7 @@
- # The vertical position of the writing point. If the vertical position
- # is outside of the bottom margin, a new page will be created.
- - attr_accessor :pointer
- + attr_reader :pointer
- def pointer=(y) #:nodoc:
- @y = y
- start_new_page if @y < @bottom_margin
- @@ -1874,26 +1864,22 @@
- # The width of the currently active column. This will return zero (0) if
- # columns are off.
- - attr_reader :column_width
- def column_width #:nodoc:
- return 0 unless @columns_on
- @columns[:width]
- end
- # The gutter between columns. This will return zero (0) if columns are
- # off.
- - attr_reader :column_gutter
- def column_gutter #:nodoc:
- return 0 unless @columns_on
- @columns[:gutter]
- end
- # The current column number. Returns zero (0) if columns are off.
- - attr_reader :column_number
- def column_number #:nodoc:
- return 0 unless @columns_on
- @columns[:current]
- end
- # The total number of columns. Returns zero (0) if columns are off.
- - attr_reader :column_count
- def column_count #:nodoc:
- return 0 unless @columns_on
- @columns[:size]
- Index: writer/lang.rb
- ===================================================================
- --- writer/lang.rb (revision 202)
- +++ writer/lang.rb (working copy)
- @@ -20,7 +20,7 @@
- #
- # If the file 'pdf/writer/lang/es' contains the module
- # <tt>PDF::Writer::Lang::ES</tt>, the error messages for PDF could be
- - # localized to Español thus:
- + # localized to Espa?ol thus:
- #
- # require 'pdf/writer'
- # require 'pdf/writer/lang/es'
- @@ -29,7 +29,7 @@
- # threads will use the current language's messages.
- #
- # See PDF::Writer::Lang::EN for more information.
- - attr_accessor :language
- + attr_reader :language
- def language=(ll) #:nodoc:
- @language = ll
- @message.replace ll.instance_variable_get('@message')
- Index: writer/strokestyle.rb
- ===================================================================
- --- writer/strokestyle.rb (revision 202)
- +++ writer/strokestyle.rb (working copy)
- @@ -40,7 +40,7 @@
- # path for a distance equal to half the line width
- # and is squared off.
- # +nil+:: Keeps the current line cap.
- - attr_accessor :cap
- + attr_reader :cap
- def cap=(c) #:nodoc:
- if c.nil? or LINE_CAPS.include?(c)
- @cap = c
- @@ -66,7 +66,7 @@
- # segments is filled with a triangle, forming a
- # flattened edge on the join.
- # +nil+:: Keeps the current line join.
- - attr_accessor :join
- + attr_reader :join
- def join=(j) #:nodoc:
- if j.nil? or LINE_JOINS.include?(j)
- @join = j
Add Comment
Please, Sign In to add comment