Support frozen_string_literal in lib/redmine/export/*.rb (#26561).

Contributed by Pavel Rosický.


git-svn-id: http://svn.redmine.org/redmine/trunk@17985 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2019-03-17 06:10:53 +00:00
parent 53a6b06578
commit 72a163d8b3
2 changed files with 9 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@ -35,11 +35,12 @@ module Redmine
col_sep = l(:general_csv_separator)
encoding = Encoding.find(options[:encoding]) rescue Encoding.find(l(:general_csv_encoding))
str = ''.force_encoding(encoding)
if encoding == Encoding::UTF_8
# BOM
str = "\xEF\xBB\xBF".force_encoding(encoding)
end
str =
if encoding == Encoding::UTF_8
+"\xEF\xBB\xBF" # BOM
else
(+'').force_encoding(encoding)
end
super(str, :col_sep => col_sep, :encoding => encoding, &block)
end

View File

@ -1,4 +1,4 @@
# frozen_string_literal: false
# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2017 Jean-Philippe Lang
@ -305,7 +305,7 @@ module Redmine
if query.grouped? &&
(group = query.group_by_column.group_value(issue)) != previous_group
pdf.SetFontStyle('B',10)
group_label = group.blank? ? 'None' : group.to_s.dup
group_label = group.blank? ? +'None' : group.to_s.dup
group_label << " (#{result_count_by_group[group]})"
pdf.bookmark group_label, 0, -1
pdf.RDMCell(table_width, row_height * 2, group_label, 'LR', 1, 'L')