Skip to content

Commit

Permalink
cleanup methods so they look similar across the spreadsheet formats
Browse files Browse the repository at this point in the history
  • Loading branch information
--unset committed Feb 22, 2009
1 parent 4bb0832 commit 833d6f5
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions lib/roo/excelx.rb
Expand Up @@ -192,31 +192,31 @@ def formula?(row,col,sheet=nil)
end

# Given a cell, return the cell's style
def cell_style(row, col, sheet=nil)
sheet = @default_sheet unless sheet
read_cells(sheet) unless @cells_read[sheet]
row,col = normalize(row,col)
s_attribute = @s_attribute[sheet][[row,col]]
s_attribute ||= 0
s_attribute = s_attribute.to_i
@style_definitions[s_attribute]
end
private :cell_style
def cell_style(row, col, sheet=nil)
sheet = @default_sheet unless sheet
read_cells(sheet) unless @cells_read[sheet]
row,col = normalize(row,col)
s_attribute = @s_attribute[sheet][[row,col]]
s_attribute ||= 0
s_attribute = s_attribute.to_i
@style_definitions[s_attribute]
end
private :cell_style

# true if the cell style is bold
def bold?(*args)
cell_style(*args)[:bold]
end
# true if the cell style is bold
def bold?(*args)
cell_style(*args)[:bold]
end

# true if the cell style is italic
def italic?(*args)
cell_style(*args)[:italic]
end
# true if the cell style is italic
def italic?(*args)
cell_style(*args)[:italic]
end

# true if the cell style is underline
def underline?(*args)
cell_style(*args)[:underline]
end
# true if the cell style is underline
def underline?(*args)
cell_style(*args)[:underline]
end

# set a cell to a certain value
# (this will not be saved back to the spreadsheet file!)
Expand Down

0 comments on commit 833d6f5

Please sign in to comment.