diff options
| author | 2022-03-19 21:47:36 -0400 | |
|---|---|---|
| committer | 2022-03-19 21:47:36 -0400 | |
| commit | f5fb17e5a64b215644bc104f099dad8c2f10c37d (patch) | |
| tree | 6ad047451881cfe94f3aabe1c33b404c134a5085 /lib/roo/excelx.rb | |
| parent | 9e07e8cd4836ddc89accdb7b20152c9a4f06fd03 (diff) | |
New upstream version 2.9.0.upstream/2.9.0
Diffstat (limited to 'lib/roo/excelx.rb')
| -rwxr-xr-x | lib/roo/excelx.rb | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/roo/excelx.rb b/lib/roo/excelx.rb index f9f0ee2..91ebc1e 100755 --- a/lib/roo/excelx.rb +++ b/lib/roo/excelx.rb @@ -60,15 +60,16 @@ module Roo @filename = local_filename(filename_or_stream, @tmpdir, packed) process_zipfile(@filename || filename_or_stream) - @sheet_names = workbook.sheets.map do |sheet| - unless options[:only_visible_sheets] && sheet['state'] == 'hidden' - sheet['name'] - end - end.compact + @sheet_names = [] @sheets = [] @sheets_by_name = {} - @sheet_names.each_with_index do |sheet_name, n| - @sheets_by_name[sheet_name] = @sheets[n] = Sheet.new(sheet_name, @shared, n, sheet_options) + + workbook.sheets.each_with_index do |sheet, index| + next if options[:only_visible_sheets] && sheet['state'] == 'hidden' + + sheet_name = sheet['name'] + @sheet_names << sheet_name + @sheets_by_name[sheet_name] = @sheets[index] = Sheet.new(sheet_name, @shared, index, sheet_options) end if cell_max @@ -428,6 +429,11 @@ module Roo entries.each do |entry| path = case entry.name.downcase + when /richdata/ + # FIXME: Ignore richData as parsing is not implemented yet and can cause + # Zip::DestinationFileExistsError when including a second "styles.xml" entry + # see http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2 + nil when /sharedstrings.xml$/ "#{@tmpdir}/roo_sharedStrings.xml" when /styles.xml$/ |
