summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/worksheet/cell.rb4
-rw-r--r--lib/axlsx/workbook/worksheet/comment.rb3
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