diff options
| -rw-r--r-- | lib/axlsx/workbook/worksheet/cell.rb | 5 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/cell_serializer.rb | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index c978bde4..49afa485 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -80,6 +80,11 @@ module Axlsx defined?(@style) ? @style : 0 end + # Internal + def style_str + defined?(@style) ? @style.to_s : '0' + end + attr_accessor :raw_style # The index of the cellXfs item to be applied to this cell. diff --git a/lib/axlsx/workbook/worksheet/cell_serializer.rb b/lib/axlsx/workbook/worksheet/cell_serializer.rb index dceca7eb..30a2b5fe 100644 --- a/lib/axlsx/workbook/worksheet/cell_serializer.rb +++ b/lib/axlsx/workbook/worksheet/cell_serializer.rb @@ -12,7 +12,7 @@ module Axlsx def to_xml_string(row_index, column_index, cell, str = +'') str << '<c r="' str << Axlsx::col_ref(column_index) << Axlsx::row_ref(row_index) - str << '" s="' << cell.style.to_s << '" ' + str << '" s="' << cell.style_str << '" ' return str << '/>' if cell.value.nil? method = cell.type |
