lib/axlsx/workbook/worksheet/cell.rb in axlsx-1.1.4 vs lib/axlsx/workbook/worksheet/cell.rb in axlsx-1.1.5
- old
+ new
@@ -286,16 +286,18 @@
# @param [Integer] r_index The row index for the cell
# @param [Integer] c_index The cell index in the row.
# @param [String] str The string index the cell content will be appended to. Defaults to empty string.
# @return [String] xml text for the cell
def to_xml_string(r_index, c_index, str = '')
- return str if @value.nil?
str << '<c r="' << Axlsx::cell_r(c_index, r_index) << '" s="' << @style.to_s << '" '
+ return str << '/>' if @value.nil?
+
case @type
+
when :string
#parse formula
if @value.start_with?('=')
- str << 't="str"><f>' << @value.to_s.gsub('=', '') << '</f>'
+ str << 't="str"><f>' << @value.to_s.sub('=', '') << '</f>'
else
#parse shared
if @ssti
str << 't="s"><v>' << @ssti.to_s << '</v>'
else