Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

fix(rubocop): obey linting

as-op7fa468ed0c2a
diff --git a/app/models/work_package/pdf_export/table_of_contents.rb b/app/models/work_package/pdf_export/table_of_contents.rb
index 2b7174b604c..21fb9e6c473 100644
--- a/app/models/work_package/pdf_export/table_of_contents.rb
+++ b/app/models/work_package/pdf_export/table_of_contents.rb
@@ -141,18 +141,18 @@ module WorkPackage::PDFExport::TableOfContents
end
def write_toc_item!(toc_item, levels_indent_list)
- y = pdf.y
+ y_start_position = pdf.y
part_style, toc_item_style = build_toc_item_styles(toc_item)
indent = levels_indent_list[toc_item[:level] - 1]
write_part_float(indent[:level_indent], toc_item[:level_string], part_style)
write_part_float(0, toc_item[:page_nr_string], part_style.merge({ align: :right }))
write_toc_item_subject!(toc_item, indent[:subject_index], toc_item_style)
- write_toc_item_link(toc_item, y)
+ write_toc_item_link(toc_item, y_start_position)
end
- def write_toc_item_link(toc_item, y)
- rect = [pdf.bounds.absolute_right, pdf.y, pdf.bounds.absolute_left, y]
+ def write_toc_item_link(toc_item, y_start_position)
+ rect = [pdf.bounds.absolute_right, pdf.y, pdf.bounds.absolute_left, y_start_position]
pdf.link_annotation(rect, Border: [0, 0, 0], Dest: toc_item[:id].to_s)
end
end