Skip to content

Commit

Permalink
Fix cell children to use .content not .to_s
Browse files Browse the repository at this point in the history
  • Loading branch information
--unset committed Apr 19, 2009
1 parent ac76655 commit 128df15
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/roo/openoffice.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
Binary file added test/paragraph.ods
Binary file not shown.
1 change: 1 addition & 0 deletions test/test_roo.rb
Expand Up @@ -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"))
Expand Down

0 comments on commit 128df15

Please sign in to comment.