summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/workbook/worksheet/cell.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/axlsx/workbook/worksheet/cell.rb')
-rw-r--r--lib/axlsx/workbook/worksheet/cell.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb
index cb8dd61b..48e77e31 100644
--- a/lib/axlsx/workbook/worksheet/cell.rb
+++ b/lib/axlsx/workbook/worksheet/cell.rb
@@ -310,6 +310,7 @@ module Axlsx
# @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 << '" '
case @type
when :string
@@ -398,6 +399,7 @@ module Axlsx
elsif @type == :boolean
v ? 1 : 0
else
+ return nil if v.nil?
@type = :string
::CGI.escapeHTML(v.to_s)
end