drhuffman12
unread,Dec 19, 2010, 4:13:37 AM12/19/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ruby-roo
# require ...
class Openoffice < GenericSpreadsheet
# skipping unaltered code before here ... now for the method we are
updating:
# Returns the formula at (row,col).
# Returns nil if there is no formula.
# The method #formula? checks if there is a formula.
def formula(row,col,sheet=nil)
sheet = @default_sheet unless sheet
read_cells(sheet) unless @cells_read[sheet]
row,col = normalize(row,col)
if @formula[sheet][[row,col]] == nil
return nil
else
# return @formula[sheet][[row,col]]["oooc:".length..-1] #
Original line; this chops off the first letter of the formula name
(e.g.: "SUM" becomes "UM")
return @formula[sheet][[row,col]][("oooc:".length-1)..-1] # New
line; this includes the first letter of the formula name.
end
end
# ... method updated, continue w/ remaining code after here.
end