diff options
| author | Randy Morgan <[email protected]> | 2012-05-09 08:21:39 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-05-09 08:21:39 +0900 |
| commit | ac0600f12fb15d1b3fe0cce1ca7a2dced4cf5285 (patch) | |
| tree | 4552debc0d77b4e84b027b6be8fe90c8f17dc6bc /lib | |
| parent | 7aa25770f1d92a2b4aa2c20ef9eabf24920052f1 (diff) | |
| download | caxlsx-ac0600f12fb15d1b3fe0cce1ca7a2dced4cf5285.tar.gz caxlsx-ac0600f12fb15d1b3fe0cce1ca7a2dced4cf5285.zip | |
patch nil row style issue
https://github.com/randym/axlsx/issues/91
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/cell.rb | 4 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/comment.rb | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index fe95e529..91efa8d9 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -288,9 +288,11 @@ 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 << '" ' + return str << '/>' if @value.nil? + case @type + when :string #parse formula if @value.start_with?('=') diff --git a/lib/axlsx/workbook/worksheet/comment.rb b/lib/axlsx/workbook/worksheet/comment.rb index 7753a71a..708b6ac4 100644 --- a/lib/axlsx/workbook/worksheet/comment.rb +++ b/lib/axlsx/workbook/worksheet/comment.rb @@ -88,7 +88,8 @@ module Axlsx # by default, all columns are 5 columns wide and 5 rows high def initialize_vml_shape ws = self.comments.worksheet - @vml_shape = VmlShape.new(self, :row => ws[ref].row.index, :column => ws[ref].index) do |vml| + pos = Axlsx::name_to_indices(ref) + @vml_shape = VmlShape.new(self, :row => pos[1], :column => pos[0]) do |vml| vml.left_column = vml.row + 1 vml.right_column = vml.column + 4 vml.top_row = vml.row |
