public
Description: Fast, Nimble PDF Writer for Ruby
Homepage: http://prawn.majesticseacreature.com
Clone URL: git://github.com/sandal/prawn.git
real fix
sandal (author)
Fri Nov 07 19:31:06 -0800 2008
commit  0aa1b8608e1923454bd53286ded15320225f8173
tree    db882d6698f8ad52349a7dd24cbd4af3625848c1
parent  62ef569f5b52fff55fe895e42e209c52682b2914
...
262
263
264
265
 
266
267
268
 
269
270
 
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
 
287
 
288
289
290
291
292
293
 
 
294
295
296
297
298
 
 
299
300
 
301
302
 
303
304
305
 
306
307
308
...
262
263
264
 
265
266
267
 
268
269
270
271
272
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
274
275
276
277
 
 
 
 
278
279
280
 
 
 
 
281
282
283
 
284
285
 
286
287
288
289
290
291
292
293
0
@@ -262,47 +262,32 @@ module Prawn
0
 
0
       def draw_page(contents)
0
         return if contents.empty?
0
-
0
+ 
0
         if C(:border_style) == :grid || contents.length == 1
0
           contents.each { |e| e.border_style = :all }
0
-        else                            
0
+        else
0
           if C(:headers)
0
             contents.first.border_style = :all
0
+            contents.first.align = C(:align_headers) || :left
0
           else
0
-            contents.first.border_style  = :no_bottom
0
-          end
0
-          contents.last.border_style  = :no_top
0
-        end
0
-        if C(:headers)
0
-          contents.first.cells.each_with_index do |e,i|
0
-          if C(:align_headers)
0
-            case C(:align_headers)
0
-              when Hash
0
-                align = C(:align_headers)[i]
0
-              else
0
-                align = C(:align_headers)
0
-              end
0
-            end
0
-            e.align = align if align
0
+            contents.first.border_style = :no_bottom
0
           end
0
+          contents.last.border_style = :no_top
0
         end
0
         
0
-        if C(:header_color) && C(:headers)
0
-          contents.first.background_color = C(:header_color) 
0
-        end
0
-
0
+        contents.first.background_color = C(:header_color) if C(:header_color)
0
0
         contents.each do |x|
0
-          unless x.background_color 
0
-            if C(:row_colors)  && index >= rows_to_skip_coloring
0
-              x.background_color = next_row_color 
0
-            end
0
+          unless x.background_color
0
+            x.background_color = next_row_color if C(:row_colors)
0
           end
0
-          x.draw 
0
+          x.draw
0
         end
0
-
0
+ 
0
         reset_row_colors
0
       end
0
 
0
+
0
       def next_row_color
0
         color = C(:row_colors).shift
0
         C(:row_colors).push(color)

Comments