From 88b67ba036c038be9d2cb116bb70eac720f3e40b Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Sat, 12 May 2012 00:34:11 +0900 Subject: patch formula parsing. #92 many thanks to @alexei-lexx for not only finding this, but taking time to report the problem. --- lib/axlsx.rb | 1 + lib/axlsx/workbook/worksheet/cell.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/axlsx.rb b/lib/axlsx.rb index 6fce32b5..6e8f4e23 100644 --- a/lib/axlsx.rb +++ b/lib/axlsx.rb @@ -54,6 +54,7 @@ module Axlsx ref end + # returns the x, y position of a cell def self.name_to_indices(name) raise ArgumentError, 'invalid cell name' unless name.size > 1 v = name[/[A-Z]+/].reverse.chars.reduce({:base=>1, :i=>0}) do |val, c| diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 91efa8d9..c58ede3a 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -296,7 +296,7 @@ module Axlsx when :string #parse formula if @value.start_with?('=') - str << 't="str">' << @value.to_s.gsub('=', '') << '' + str << 't="str">' << @value.to_s.sub('=', '') << '' else #parse shared if @ssti -- cgit v1.2.3