zdavatz / spreadsheet

The Ruby Spreadsheet by ywesee GmbH
http://spreadsheet.ch
GNU General Public License v3.0
1.13k stars 240 forks source link

fix: Worksheet#<< fails to add data to the first row #260

Closed manxingxing closed 3 years ago

manxingxing commented 3 years ago

related to PR #249

when sheet is empty, last_row_index return 0. #<< actually adds data to the second row. leaving the first row blank.

to reproduce:

require 'spreadsheet'
wb = Spreadsheet::Workbook.new
sheet = wb.create_worksheet

sheet << ['A', 'B', 'C', 'D']
sheet << [1,2,3,4]

wb.write(File.expand_path('spreadsheet.xls', Dir.pwd))

image

zdavatz commented 3 years ago

Thank you, version 1.2.8 is out.