diff options
| author | 2022-03-19 21:48:07 -0400 | |
|---|---|---|
| committer | 2022-03-19 21:48:07 -0400 | |
| commit | a6e765da9b4da8cf9ddedcbaeb29fe5dca5df263 (patch) | |
| tree | 39a2e5d06c16d048e9618e1170e3b6304fbade2e /lib/roo/excelx.rb | |
| parent | e67f4551479264125a641b955523d95e192b6d44 (diff) | |
| parent | f5fb17e5a64b215644bc104f099dad8c2f10c37d (diff) | |
Update upstream source from tag 'upstream/2.9.0'
Update to upstream version '2.9.0'
with Debian dir 41b8f9c552bbf25b076de11901d6f615d684366f
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$/ |
