Project

General

Profile

Patch #10464 » pdf-issues-alignment.diff

Toshi MARUYAMA, 2012-03-20 08:15

View differences:

lib/redmine/export/pdf.rb
359 359
            end
360 360
          end
361 361
        end
362

  
363
        # calculate columns alignment
364
        @col_align = col_width.map {|x| x > table_width / (col_width.count + 1) ? 'L' : 'C'}
365

  
362 366
        col_width
363 367
      end
364 368

  
......
466 470
      # Renders MultiCells and returns the maximum height used
467 471
      def issues_to_pdf_write_cells(pdf, col_values, col_widths,
468 472
                                    row_height, head=false)
473
        @col_align ||= []
469 474
        base_y = pdf.GetY
470 475
        max_height = row_height
471 476
        col_values.each_with_index do |column, i|
472 477
          col_x = pdf.GetX
473 478
          if head == true
474
            pdf.RDMMultiCell(col_widths[i], row_height, column.caption, "T", 'L', 1)
479
            pdf.RDMMultiCell(col_widths[i], row_height, column.caption, "T", 'C', 1)
475 480
          else
476
            pdf.RDMMultiCell(col_widths[i], row_height, column, "T", 'L', 1)
481
            @col_align[i] = 'L' if @col_align[i].nil?
482
            pdf.RDMMultiCell(col_widths[i], row_height, column, "T", @col_align[i], 1)
477 483
          end
478 484
          max_height = (pdf.GetY - base_y) if (pdf.GetY - base_y) > max_height
479 485
          pdf.SetXY(col_x + col_widths[i], base_y);
(10-10/10)