From 32c027461698a81142772d60f142996f2fa2e113 Mon Sep 17 00:00:00 2001 From: Jurriaan Pruis Date: Mon, 2 Apr 2012 13:48:14 +0200 Subject: Support nil cells for all types --- lib/axlsx/workbook/worksheet/cell.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 48e77e31..6f90dfa7 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -386,6 +386,7 @@ module Axlsx # About Time - Time in OOXML is *different* from what you might expect. The history as to why is interesting, but you can safely assume that if you are generating docs on a mac, you will want to specify Workbook.1904 as true when using time typed values. # @see Axlsx#date1904 def cast_value(v) + return nil if v.nil? if @type == :date self.style = STYLE_DATE if self.style == 0 v @@ -399,7 +400,6 @@ module Axlsx elsif @type == :boolean v ? 1 : 0 else - return nil if v.nil? @type = :string ::CGI.escapeHTML(v.to_s) end -- cgit v1.2.3