Guest User

Untitled

a guest
Jul 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.63 KB | None | 0 0
  1. Index: writer.rb
  2. ===================================================================
  3. --- writer.rb (revision 202)
  4. +++ writer.rb (working copy)
  5. @@ -430,13 +430,13 @@
  6. # Sets the document to compressed (+true+) or uncompressed (+false+).
  7. # Defaults to uncompressed. This can ONLY be set once and should be set
  8. # as early as possible in the document creation process.
  9. - attr_accessor :compressed
  10. + attr_reader :compressed
  11. def compressed=(cc) #:nodoc:
  12. @compressed = cc if @compressed.nil?
  13. end
  14. # Returns +true+ if the document is compressed.
  15. def compressed?
  16. - @compressed == true
  17. + defined?(@compressed) and @compressed == true
  18. end
  19. # The set of known labelled destinations. All destinations are of class
  20. # PDF::Writer::Object::Destination. This is of little interest to
  21. @@ -467,53 +467,43 @@
  22. attr_reader :page_height
  23.  
  24. # The absolute x position of the left margin.
  25. - attr_reader :absolute_left_margin
  26. def absolute_left_margin #:nodoc:
  27. @left_margin
  28. end
  29. # The absolute x position of the right margin.
  30. - attr_reader :absolute_right_margin
  31. def absolute_right_margin #:nodoc:
  32. @page_width - @right_margin
  33. end
  34. # Returns the absolute y position of the top margin.
  35. - attr_reader :absolute_top_margin
  36. def absolute_top_margin #:nodoc:
  37. @page_height - @top_margin
  38. end
  39. # Returns the absolute y position of the bottom margin.
  40. - attr_reader :absolute_bottom_margin
  41. def absolute_bottom_margin #:nodoc:
  42. @bottom_margin
  43. end
  44.  
  45. # The height of the margin area.
  46. - attr_reader :margin_height
  47. def margin_height #:nodoc:
  48. absolute_top_margin - absolute_bottom_margin
  49. end
  50. # The width of the margin area.
  51. - attr_reader :margin_width
  52. def margin_width #:nodoc:
  53. absolute_right_margin - absolute_left_margin
  54. end
  55. # The absolute x middle position.
  56. - attr_reader :absolute_x_middle
  57. def absolute_x_middle #:nodoc:
  58. @page_width / 2.0
  59. end
  60. # The absolute y middle position.
  61. - attr_reader :absolute_y_middle
  62. def absolute_y_middle #:nodoc:
  63. @page_height / 2.0
  64. end
  65. # The middle of the writing area between the left and right margins.
  66. - attr_reader :margin_x_middle
  67. def margin_x_middle #:nodoc:
  68. (absolute_right_margin + absolute_left_margin) / 2.0
  69. end
  70. # The middle of the writing area between the top and bottom margins.
  71. - attr_reader :margin_y_middle
  72. def margin_y_middle #:nodoc:
  73. (absolute_top_margin + absolute_bottom_margin) / 2.0
  74. end
  75. @@ -522,7 +512,7 @@
  76. # constrained between the top and bottom margins. Any attempt to set it
  77. # outside of those margins will cause the y pointer to be placed
  78. # absolutely at the margins.
  79. - attr_accessor :y
  80. + attr_reader :y
  81. def y=(yy) #:nodoc:
  82. @y = yy
  83. @y = absolute_top_margin if @y > absolute_top_margin
  84. @@ -531,7 +521,7 @@
  85.  
  86. # The vertical position of the writing point. If the vertical position
  87. # is outside of the bottom margin, a new page will be created.
  88. - attr_accessor :pointer
  89. + attr_reader :pointer
  90. def pointer=(y) #:nodoc:
  91. @y = y
  92. start_new_page if @y < @bottom_margin
  93. @@ -1874,26 +1864,22 @@
  94.  
  95. # The width of the currently active column. This will return zero (0) if
  96. # columns are off.
  97. - attr_reader :column_width
  98. def column_width #:nodoc:
  99. return 0 unless @columns_on
  100. @columns[:width]
  101. end
  102. # The gutter between columns. This will return zero (0) if columns are
  103. # off.
  104. - attr_reader :column_gutter
  105. def column_gutter #:nodoc:
  106. return 0 unless @columns_on
  107. @columns[:gutter]
  108. end
  109. # The current column number. Returns zero (0) if columns are off.
  110. - attr_reader :column_number
  111. def column_number #:nodoc:
  112. return 0 unless @columns_on
  113. @columns[:current]
  114. end
  115. # The total number of columns. Returns zero (0) if columns are off.
  116. - attr_reader :column_count
  117. def column_count #:nodoc:
  118. return 0 unless @columns_on
  119. @columns[:size]
  120. Index: writer/lang.rb
  121. ===================================================================
  122. --- writer/lang.rb (revision 202)
  123. +++ writer/lang.rb (working copy)
  124. @@ -20,7 +20,7 @@
  125. #
  126. # If the file 'pdf/writer/lang/es' contains the module
  127. # <tt>PDF::Writer::Lang::ES</tt>, the error messages for PDF could be
  128. - # localized to Español thus:
  129. + # localized to Espa?ol thus:
  130. #
  131. # require 'pdf/writer'
  132. # require 'pdf/writer/lang/es'
  133. @@ -29,7 +29,7 @@
  134. # threads will use the current language's messages.
  135. #
  136. # See PDF::Writer::Lang::EN for more information.
  137. - attr_accessor :language
  138. + attr_reader :language
  139. def language=(ll) #:nodoc:
  140. @language = ll
  141. @message.replace ll.instance_variable_get('@message')
  142. Index: writer/strokestyle.rb
  143. ===================================================================
  144. --- writer/strokestyle.rb (revision 202)
  145. +++ writer/strokestyle.rb (working copy)
  146. @@ -40,7 +40,7 @@
  147. # path for a distance equal to half the line width
  148. # and is squared off.
  149. # +nil+:: Keeps the current line cap.
  150. - attr_accessor :cap
  151. + attr_reader :cap
  152. def cap=(c) #:nodoc:
  153. if c.nil? or LINE_CAPS.include?(c)
  154. @cap = c
  155. @@ -66,7 +66,7 @@
  156. # segments is filled with a triangle, forming a
  157. # flattened edge on the join.
  158. # +nil+:: Keeps the current line join.
  159. - attr_accessor :join
  160. + attr_reader :join
  161. def join=(j) #:nodoc:
  162. if j.nil? or LINE_JOINS.include?(j)
  163. @join = j
Add Comment
Please, Sign In to add comment