two other typos

This commit is contained in:
Sinan Yumurtaci
2024-12-09 23:47:47 -06:00
committed by Nicolás Hatcher Andrés
parent 075760b7ba
commit 7058a59c45
2 changed files with 4 additions and 4 deletions

View File

@@ -35,7 +35,7 @@ pub struct WorkbookView {
pub sheet: u32, pub sheet: u32,
/// The current width of the window /// The current width of the window
pub window_width: i64, pub window_width: i64,
/// The current heigh of the window /// The current height of the window
pub window_height: i64, pub window_height: i64,
} }

View File

@@ -713,7 +713,7 @@ impl UserModel {
/// Paste `styles` in the selected area /// Paste `styles` in the selected area
pub fn on_paste_styles(&mut self, styles: &[Vec<Style>]) -> Result<(), String> { pub fn on_paste_styles(&mut self, styles: &[Vec<Style>]) -> Result<(), String> {
let styles_heigh = styles.len() as i32; let styles_height = styles.len() as i32;
let styles_width = styles[0].len() as i32; let styles_width = styles[0].len() as i32;
let sheet = if let Some(view) = self.model.workbook.views.get(&self.model.view_id) { let sheet = if let Some(view) = self.model.workbook.views.get(&self.model.view_id) {
view.sheet view.sheet
@@ -732,13 +732,13 @@ impl UserModel {
// If the pasted area is smaller than the selected area we increase it // If the pasted area is smaller than the selected area we increase it
let [row_start, column_start, row_end, column_end] = range; let [row_start, column_start, row_end, column_end] = range;
let last_row = row_end.max(row_start + styles_heigh - 1); let last_row = row_end.max(row_start + styles_height - 1);
let last_column = column_end.max(column_start + styles_width - 1); let last_column = column_end.max(column_start + styles_width - 1);
let mut diff_list = Vec::new(); let mut diff_list = Vec::new();
for row in row_start..=last_row { for row in row_start..=last_row {
for column in column_start..=last_column { for column in column_start..=last_column {
let row_index = ((row - row_start) % styles_heigh) as usize; let row_index = ((row - row_start) % styles_height) as usize;
let column_index = ((column - column_start) % styles_width) as usize; let column_index = ((column - column_start) % styles_width) as usize;
let style = &styles[row_index][column_index]; let style = &styles[row_index][column_index];
let old_value = self.model.get_style_for_cell(sheet, row, column)?; let old_value = self.model.get_style_for_cell(sheet, row, column)?;