docs: style path documentation

This commit is contained in:
Jeremy Wall 2025-02-13 19:42:25 -05:00
parent 3219e01176
commit 7ffd420029
2 changed files with 42 additions and 4 deletions

4
Cargo.lock generated
View File

@ -841,7 +841,7 @@ dependencies = [
[[package]]
name = "ironcalc"
version = "0.3.0"
source = "git+https://github.com/ironcalc/IronCalc?rev=264fcac63cc93b08a4b4a6764815e0c0adf6a53c#99125f1fea1c8c72c61f8cba94d847ed3471a4af"
source = "git+https://github.com/ironcalc/IronCalc?rev=264fcac63cc93b08a4b4a6764815e0c0adf6a53c#7e54cb6aa27f6d02fc3b090de4fb127c67900dc8"
dependencies = [
"bitcode",
"chrono",
@ -857,7 +857,7 @@ dependencies = [
[[package]]
name = "ironcalc_base"
version = "0.3.0"
source = "git+https://github.com/ironcalc/IronCalc?rev=264fcac63cc93b08a4b4a6764815e0c0adf6a53c#99125f1fea1c8c72c61f8cba94d847ed3471a4af"
source = "git+https://github.com/ironcalc/IronCalc?rev=264fcac63cc93b08a4b4a6764815e0c0adf6a53c#7e54cb6aa27f6d02fc3b090de4fb127c67900dc8"
dependencies = [
"bitcode",
"chrono",

View File

@ -278,14 +278,26 @@ impl Book {
// not use a style.
match self
.model
.get_model()
.get_style_for_cell(sheet, cell.row as i32, cell.col as i32)
.get_cell_style(sheet, cell.row as i32, cell.col as i32)
{
Err(_) => None,
Ok(s) => Some(s),
}
}
/// Set the cell style
/// Valid style paths are:
/// * fill.bg_color background color
/// * fill.fg_color foreground color
/// * font.b bold
/// * font.i italicize
/// * font.strike strikethrough
/// * font.color font color
/// * num_fmt number format
/// * alignment turn off alignment
/// * alignment.horizontal make alignment horzontal
/// * alignment.vertical make alignment vertical
/// * alignment.wrap_text wrap cell text
pub fn set_cell_style(&mut self, style: &[(&str, &str)], area: &Area) -> Result<()> {
for (path, val) in style {
self.model
@ -315,6 +327,19 @@ impl Book {
}
}
/// Set the column style.
/// Valid style paths are:
/// * fill.bg_color background color
/// * fill.fg_color foreground color
/// * font.b bold
/// * font.i italicize
/// * font.strike strikethrough
/// * font.color font color
/// * num_fmt number format
/// * alignment turn off alignment
/// * alignment.horizontal make alignment horzontal
/// * alignment.vertical make alignment vertical
/// * alignment.wrap_text wrap cell text
pub fn set_col_style(
&mut self,
style: &[(&str, &str)],
@ -332,6 +357,19 @@ impl Book {
Ok(())
}
/// Set the row style
/// Valid style paths are:
/// * fill.bg_color background color
/// * fill.fg_color foreground color
/// * font.b bold
/// * font.i italicize
/// * font.strike strikethrough
/// * font.color font color
/// * num_fmt number format
/// * alignment turn off alignment
/// * alignment.horizontal make alignment horzontal
/// * alignment.vertical make alignment vertical
/// * alignment.wrap_text wrap cell text
pub fn set_row_style(
&mut self,
style: &[(&str, &str)],