Skip to content

Commit

Permalink
Format editable rows to not be locked by default and force string-for…
Browse files Browse the repository at this point in the history
…matting
  • Loading branch information
payten committed Oct 13, 2021
1 parent 382fe3b commit 7b03599
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend/model/spreadsheet_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -693,11 +693,17 @@ def to_stream
sheet.set_row(0, nil, human_header_format)
sheet.set_row(1, nil, locked)

# format editable rows to not be locked by default and force
# string-formatting
row_format = wb.add_format
row_format.set_num_format(0x31)
row_format.set_locked(0)

rowidx = 2
dataset_iterator do |row_values, locked_column_indexes|
# Unlock the entire row to speed things up as we no longer have to write
# to all the empty cells to unlock them.
sheet.set_row(rowidx, nil, unlocked)
sheet.set_row(rowidx, nil, row_format)

row_values.each_with_index do |columnAndValue, i|
if columnAndValue.value
Expand Down

0 comments on commit 7b03599

Please sign in to comment.