diff --git a/lib/axlsx/workbook/worksheet/comment.rb b/lib/axlsx/workbook/worksheet/comment.rb index e5dbe41c..1c5e220c 100644 --- a/lib/axlsx/workbook/worksheet/comment.rb +++ b/lib/axlsx/workbook/worksheet/comment.rb @@ -66,11 +66,11 @@ def to_xml_string(str = "") str << '' unless author.to_s == "" str << '' - str << ("" << ::CGI.escapeHTML(author.to_s) << ":\n") + str << ('' << ::CGI.escapeHTML(author.to_s) << ":\n") end str << '' str << '' - str << ('' << ::CGI.escapeHTML(text) << '') + str << ('' << ::CGI.escapeHTML(text) << '') str << '' end @@ -82,9 +82,9 @@ def initialize_vml_shape pos = Axlsx::name_to_indices(ref) @vml_shape = VmlShape.new(:row => pos[1], :column => pos[0], :visible => @visible) do |vml| vml.left_column = vml.column - vml.right_column = vml.column + 2 + vml.right_column = vml.column + 2 vml.top_row = vml.row - vml.bottom_row = vml.row + 4 + vml.bottom_row = vml.row + 4 end end end diff --git a/lib/schema/sml.xsd b/lib/schema/sml.xsd index 3a67d0f2..71726af9 100644 --- a/lib/schema/sml.xsd +++ b/lib/schema/sml.xsd @@ -10,11 +10,11 @@ schemaLocation="shared-relationshipReference.xsd"/> - - - + + @@ -1799,7 +1799,7 @@ - + @@ -1827,7 +1827,7 @@ - + @@ -1857,6 +1857,13 @@ + + + + + + + @@ -2216,7 +2223,7 @@ - + @@ -3776,7 +3783,7 @@ - + @@ -3791,15 +3798,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/test/workbook/worksheet/tc_comment.rb b/test/workbook/worksheet/tc_comment.rb index e66abb9a..4d4eabe4 100644 --- a/test/workbook/worksheet/tc_comment.rb +++ b/test/workbook/worksheet/tc_comment.rb @@ -55,6 +55,7 @@ def test_to_xml_string assert_equal(doc.xpath("//comment[@authorId='#{@c1.author_index.to_s}']").size, 1) assert_equal(doc.xpath("//t[text()='#{@c1.author}:\n']").size, 1) assert_equal(doc.xpath("//t[text()='#{@c1.text}']").size, 1) + assert_equal(doc.xpath("//t[text()='#{@c1.text}'][@xml:space='preserve']").size, 1) end def test_comment_text_contain_author_and_text