diff options
| author | 2019-01-14 01:41:26 -0500 | |
|---|---|---|
| committer | 2019-01-14 01:41:26 -0500 | |
| commit | 6aa7e04e06423e7d92ede727489ea346e88f7108 (patch) | |
| tree | 9bdec92fd17898b662235bc0a491de827990130c /lib/roo/open_office.rb | |
| parent | c59817e300dbe1aab3120cad603cdb14b14ed78b (diff) | |
| parent | dddfa903d2b856146f05ffb4415c31d6127bb5bf (diff) | |
Update upstream source from tag 'upstream/2.8.0'
Update to upstream version '2.8.0'
with Debian dir 569f5866fbcf4e449c6c48dc5d20a3ab54f95252
Diffstat (limited to 'lib/roo/open_office.rb')
| -rw-r--r-- | lib/roo/open_office.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/roo/open_office.rb b/lib/roo/open_office.rb index 6ccbe85..f172363 100644 --- a/lib/roo/open_office.rb +++ b/lib/roo/open_office.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'date' require 'nokogiri' require 'cgi' @@ -11,9 +13,9 @@ module Roo class OpenOffice < Roo::Base extend Roo::Tempdir - ERROR_MISSING_CONTENT_XML = 'file missing required content.xml'.freeze - XPATH_FIND_TABLE_STYLES = "//*[local-name()='automatic-styles']".freeze - XPATH_LOCAL_NAME_TABLE = "//*[local-name()='table']".freeze + ERROR_MISSING_CONTENT_XML = 'file missing required content.xml' + XPATH_FIND_TABLE_STYLES = "//*[local-name()='automatic-styles']" + XPATH_LOCAL_NAME_TABLE = "//*[local-name()='table']" # initialization and opening of a spreadsheet file # values for packed: :zip @@ -561,7 +563,7 @@ module Roo end def read_labels - @label ||= Hash[doc.xpath('//table:named-range').map do |ne| + @label ||= doc.xpath('//table:named-range').each_with_object({}) do |ne, hash| #- # $Sheet1.$C$5 #+ @@ -569,8 +571,8 @@ module Roo sheetname, coords = attribute(ne, 'cell-range-address').to_s.split('.$') col, row = coords.split('$') sheetname = sheetname[1..-1] if sheetname[0, 1] == '$' - [name, [sheetname, row, col]] - end] + hash[name] = [sheetname, row, col] + end end def read_styles(style_elements) |
