Method: Openoffice#formula

Defined in:
lib/roo/openoffice.rb

#formula(row, col, sheet = nil) ⇒ Object

Returns the formula at (row,col). Returns nil if there is no formula. The method #formula? checks if there is a formula.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/roo/openoffice.rb', line 88

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]

    # TODO:

    #str = @formula[sheet][[row,col]]

    #if str.include? ':'

     #return str[str.index(':')+1..-1]

    #else

     #return str

    #end

    @formula[sheet][[row,col]]
  end
end