Skip to content
Browse files

Fix cell children to use .content not .to_s

  • Loading branch information...
1 parent ac76655 commit 128df15c904d8ce6ca19c60debc2066e8104200c @hmcgowan hmcgowan committed
Showing with 3 additions and 2 deletions.
  1. +2 −2 lib/roo/openoffice.rb
  2. BIN test/paragraph.ods
  3. +1 −0 test/test_roo.rb
View
4 lib/roo/openoffice.rb
@@ -306,7 +306,7 @@ def read_cells(sheet=nil)
str_v += children_to_string(str.children)
else
str.children.each do |child|
- str_v = str_v + child.to_s #.text
+ str_v = str_v + child.content #.text
end
end
str_v.gsub!(/'/,"'") # special case not supported by unescapeHTML
@@ -447,7 +447,7 @@ def children_to_string(children)
end
result = result + " "*compressed_spaces
else
- result = result + child.to_s
+ result = result + child.content
end
end
}
View
BIN test/paragraph.ods
Binary file not shown.
View
1 test/test_roo.rb
@@ -4879,6 +4879,7 @@ def test_cell_multiline
oo = Openoffice.new(File.join(TESTDIR,"paragraph.ods"))
oo.default_sheet = oo.sheets.first
assert_equal "This is a test\nof a multiline\nCell", oo.cell(1,1)
+ assert_equal "This is a test\n\nof a multiline\n\nCell", oo.cell(1,2)
end
# if EXCELX
# oo = Excelx.new(File.join(TESTDIR,"boolean.xlsx"))

0 comments on commit 128df15

Please sign in to comment.
Something went wrong with that request. Please try again.