aboutsummaryrefslogtreecommitdiffstats
path: root/lib/roo/excelx/sheet_doc.rb
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2023-02-08 00:40:16 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2023-02-08 00:40:16 -0500
commitb0bc0772184c68b8d4baac678c5fb707dc23af7f (patch)
tree62c95563dd5d57e9db8268227acf4cc91e75af04 /lib/roo/excelx/sheet_doc.rb
parente44f5d5d1935ee40a6bbb232e649d91e8aa9ce74 (diff)
parentae103e148eb3c15606b816505492d870ef062ad3 (diff)
Update upstream source from tag 'upstream/2.10.0'
Update to upstream version '2.10.0' with Debian dir 3c0f78b1f632920ec992d7bf7e43a8b0ced0b21d
Diffstat (limited to 'lib/roo/excelx/sheet_doc.rb')
-rwxr-xr-xlib/roo/excelx/sheet_doc.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/roo/excelx/sheet_doc.rb b/lib/roo/excelx/sheet_doc.rb
index adbb77a..7a09725 100755
--- a/lib/roo/excelx/sheet_doc.rb
+++ b/lib/roo/excelx/sheet_doc.rb
@@ -211,10 +211,19 @@ module Roo
extracted_cells = {}
empty_cell = @options[:empty_cell]
- doc.xpath('/worksheet/sheetData/row/c').each do |cell_xml|
- coordinate = ::Roo::Utils.extract_coordinate(cell_xml["r"])
- cell = cell_from_xml(cell_xml, hyperlinks(relationships)[coordinate], coordinate, empty_cell)
- extracted_cells[coordinate] = cell if cell
+ doc.xpath('/worksheet/sheetData/row').each.with_index(1) do |row_xml, ycoord|
+ row_xml.xpath('c').each.with_index(1) do |cell_xml, xcoord|
+ r = cell_xml['r']
+ coordinate =
+ if r.nil?
+ ::Roo::Excelx::Coordinate.new(ycoord, xcoord)
+ else
+ ::Roo::Utils.extract_coordinate(r)
+ end
+
+ cell = cell_from_xml(cell_xml, hyperlinks(relationships)[coordinate], coordinate, empty_cell)
+ extracted_cells[coordinate] = cell if cell
+ end
end
expand_merged_ranges(extracted_cells) if @options[:expand_merged_ranges]