UPDATE: Introducing TironCalc, or Tiron for friends

This commit is contained in:
Nicolas Hatcher
2024-05-01 08:26:49 +02:00
committed by Nicolás Hatcher
parent 55a043366a
commit 08e35f209d
8 changed files with 1062 additions and 15 deletions

View File

@@ -292,7 +292,10 @@ fn vertical(value: &str) -> Result<VerticalAlignment, String> {
/// # }
/// ```
pub struct UserModel {
model: Model,
/// The underlying model
/// See also:
/// * [Model]
pub model: Model,
history: History,
send_queue: Vec<QueueDiffs>,
pause_evaluation: bool,
@@ -645,7 +648,9 @@ impl UserModel {
pub fn insert_row(&mut self, sheet: u32, row: i32) -> Result<(), String> {
let diff_list = vec![Diff::InsertRow { sheet, row }];
self.push_diff_list(diff_list);
self.model.insert_rows(sheet, row, 1)
self.model.insert_rows(sheet, row, 1)?;
self.model.evaluate();
Ok(())
}
/// Deletes a row
@@ -672,7 +677,9 @@ impl UserModel {
old_data,
}];
self.push_diff_list(diff_list);
self.model.delete_rows(sheet, row, 1)
self.model.delete_rows(sheet, row, 1)?;
self.model.evaluate();
Ok(())
}
/// Inserts a column
@@ -682,7 +689,9 @@ impl UserModel {
pub fn insert_column(&mut self, sheet: u32, column: i32) -> Result<(), String> {
let diff_list = vec![Diff::InsertColumn { sheet, column }];
self.push_diff_list(diff_list);
self.model.insert_columns(sheet, column, 1)
self.model.insert_columns(sheet, column, 1)?;
self.model.evaluate();
Ok(())
}
/// Deletes a column
@@ -727,7 +736,9 @@ impl UserModel {
}),
}];
self.push_diff_list(diff_list);
self.model.delete_columns(sheet, column, 1)
self.model.delete_columns(sheet, column, 1)?;
self.model.evaluate();
Ok(())
}
/// Sets the width of a column