Fixing formatting issue that is causing the build to fail.
This commit is contained in:
@@ -37,7 +37,7 @@ impl Model {
|
|||||||
&self,
|
&self,
|
||||||
sheet: u32,
|
sheet: u32,
|
||||||
row: i32,
|
row: i32,
|
||||||
descending: bool
|
descending: bool,
|
||||||
) -> Result<Vec<i32>, String> {
|
) -> Result<Vec<i32>, String> {
|
||||||
let worksheet = self.workbook.worksheet(sheet)?;
|
let worksheet = self.workbook.worksheet(sheet)?;
|
||||||
if let Some(row_data) = worksheet.sheet_data.get(&row) {
|
if let Some(row_data) = worksheet.sheet_data.get(&row) {
|
||||||
@@ -67,9 +67,10 @@ impl Model {
|
|||||||
source_row: i32,
|
source_row: i32,
|
||||||
source_column: i32,
|
source_column: i32,
|
||||||
target_row: i32,
|
target_row: i32,
|
||||||
target_column: i32
|
target_column: i32,
|
||||||
) -> Result<(), String> {
|
) -> Result<(), String> {
|
||||||
let source_cell = self.workbook
|
let source_cell = self
|
||||||
|
.workbook
|
||||||
.worksheet(sheet)?
|
.worksheet(sheet)?
|
||||||
.cell(source_row, source_column)
|
.cell(source_row, source_column)
|
||||||
.ok_or("Expected Cell to exist")?;
|
.ok_or("Expected Cell to exist")?;
|
||||||
@@ -79,7 +80,9 @@ impl Model {
|
|||||||
.cell_formula(sheet, source_row, source_column)?
|
.cell_formula(sheet, source_row, source_column)?
|
||||||
.unwrap_or_else(|| source_cell.get_text(&self.workbook.shared_strings, &self.language));
|
.unwrap_or_else(|| source_cell.get_text(&self.workbook.shared_strings, &self.language));
|
||||||
self.set_user_input(sheet, target_row, target_column, formula_or_value);
|
self.set_user_input(sheet, target_row, target_column, formula_or_value);
|
||||||
self.workbook.worksheet_mut(sheet)?.set_cell_style(target_row, target_column, style);
|
self.workbook
|
||||||
|
.worksheet_mut(sheet)?
|
||||||
|
.set_cell_style(target_row, target_column, style);
|
||||||
self.delete_cell(sheet, source_row, source_column)?;
|
self.delete_cell(sheet, source_row, source_column)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -97,7 +100,7 @@ impl Model {
|
|||||||
&mut self,
|
&mut self,
|
||||||
sheet: u32,
|
sheet: u32,
|
||||||
column: i32,
|
column: i32,
|
||||||
column_count: i32
|
column_count: i32,
|
||||||
) -> Result<(), String> {
|
) -> Result<(), String> {
|
||||||
if column_count <= 0 {
|
if column_count <= 0 {
|
||||||
return Err("Cannot add a negative number of cells :)".to_string());
|
return Err("Cannot add a negative number of cells :)".to_string());
|
||||||
@@ -107,7 +110,8 @@ impl Model {
|
|||||||
let last_column = dimensions.max_column + column_count;
|
let last_column = dimensions.max_column + column_count;
|
||||||
if last_column > LAST_COLUMN {
|
if last_column > LAST_COLUMN {
|
||||||
return Err(
|
return Err(
|
||||||
"Cannot shift cells because that would delete cells at the end of a row".to_string()
|
"Cannot shift cells because that would delete cells at the end of a row"
|
||||||
|
.to_string(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
let worksheet = self.workbook.worksheet(sheet)?;
|
let worksheet = self.workbook.worksheet(sheet)?;
|
||||||
@@ -130,7 +134,7 @@ impl Model {
|
|||||||
sheet,
|
sheet,
|
||||||
column,
|
column,
|
||||||
delta: column_count,
|
delta: column_count,
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -147,7 +151,7 @@ impl Model {
|
|||||||
&mut self,
|
&mut self,
|
||||||
sheet: u32,
|
sheet: u32,
|
||||||
column: i32,
|
column: i32,
|
||||||
column_count: i32
|
column_count: i32,
|
||||||
) -> Result<(), String> {
|
) -> Result<(), String> {
|
||||||
if column_count <= 0 {
|
if column_count <= 0 {
|
||||||
return Err("Please use insert columns instead".to_string());
|
return Err("Please use insert columns instead".to_string());
|
||||||
@@ -178,7 +182,7 @@ impl Model {
|
|||||||
sheet,
|
sheet,
|
||||||
column,
|
column,
|
||||||
delta: -column_count,
|
delta: -column_count,
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -200,7 +204,8 @@ impl Model {
|
|||||||
let last_row = dimensions.max_row + row_count;
|
let last_row = dimensions.max_row + row_count;
|
||||||
if last_row > LAST_ROW {
|
if last_row > LAST_ROW {
|
||||||
return Err(
|
return Err(
|
||||||
"Cannot shift cells because that would delete cells at the end of a column".to_string()
|
"Cannot shift cells because that would delete cells at the end of a column"
|
||||||
|
.to_string(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,7 +248,7 @@ impl Model {
|
|||||||
sheet,
|
sheet,
|
||||||
row,
|
row,
|
||||||
delta: row_count,
|
delta: row_count,
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -304,7 +309,7 @@ impl Model {
|
|||||||
sheet,
|
sheet,
|
||||||
row,
|
row,
|
||||||
delta: -row_count,
|
delta: -row_count,
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -325,7 +330,7 @@ impl Model {
|
|||||||
&mut self,
|
&mut self,
|
||||||
sheet: u32,
|
sheet: u32,
|
||||||
column: i32,
|
column: i32,
|
||||||
delta: i32
|
delta: i32,
|
||||||
) -> Result<(), &'static str> {
|
) -> Result<(), &'static str> {
|
||||||
// Check boundaries
|
// Check boundaries
|
||||||
let target_column = column + delta;
|
let target_column = column + delta;
|
||||||
@@ -344,7 +349,7 @@ impl Model {
|
|||||||
sheet,
|
sheet,
|
||||||
column,
|
column,
|
||||||
delta,
|
delta,
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user