summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-04-12 10:53:35 +0900
committerRandy Morgan <[email protected]>2012-04-12 10:53:35 +0900
commita43a642eb11dbcd55acb26fe6258ce8cf817b52b (patch)
tree6de03402cdebd515e5c7f9fa55c639c66f1374dc /lib
parent2d96b4cb97f19d4cb2cdf1a31d34b13e61fe0a3f (diff)
downloadcaxlsx-a43a642eb11dbcd55acb26fe6258ce8cf817b52b.tar.gz
caxlsx-a43a642eb11dbcd55acb26fe6258ce8cf817b52b.zip
fix bug for autowidth in handling nil cells.
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/worksheet/worksheet.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb
index 41b3cb73..cf3334ca 100644
--- a/lib/axlsx/workbook/worksheet/worksheet.rb
+++ b/lib/axlsx/workbook/worksheet/worksheet.rb
@@ -466,7 +466,7 @@ module Axlsx
col.width = width if [Integer, Float, Fixnum].include?(width.class)
c_style = style[index] if [Integer, Fixnum].include?(style[index].class)
#BUG - col.width wil only be nil the first time the column object is created. Subsequent row adds will not update the width of the column! col.width ||
- next if width == :ignore || col.width || (cell.value.is_a?(String) && cell.value.start_with?('='))
+ next if width == :ignore || col.width || (cell.value.is_a?(String) && cell.value.start_with?('=') || cell.value == nil)
if self.workbook.use_autowidth
cell_xf = cellXfs[(c_style || 0)]
font = fonts[(cell_xf.fontId || 0)]