summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJurriaan Pruis <[email protected]>2012-04-02 13:48:14 +0200
committerJurriaan Pruis <[email protected]>2012-04-02 13:48:14 +0200
commit32c027461698a81142772d60f142996f2fa2e113 (patch)
treec621ca9a0f958b88904da502d28f32632e07978a
parent24079401c00af3b000644a57b82627556deea596 (diff)
downloadcaxlsx-32c027461698a81142772d60f142996f2fa2e113.tar.gz
caxlsx-32c027461698a81142772d60f142996f2fa2e113.zip
Support nil cells for all types
-rw-r--r--lib/axlsx/workbook/worksheet/cell.rb2
1 files changed, 1 insertions, 1 deletions
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