UPDATE[API rename]: set_column_with => set_columns_with
Similarly set_row_height => set_rows_height
This commit is contained in:
committed by
Nicolás Hatcher Andrés
parent
dd9ca4224d
commit
4095b7db6e
@@ -9,7 +9,7 @@ fn add_undo_redo() {
|
||||
model.set_user_input(1, 1, 1, "=1 + 1").unwrap();
|
||||
model.set_user_input(1, 1, 2, "=A1*3").unwrap();
|
||||
model
|
||||
.set_column_width(1, 5, 5.0 * DEFAULT_COLUMN_WIDTH)
|
||||
.set_columns_width(1, 5, 5, 5.0 * DEFAULT_COLUMN_WIDTH)
|
||||
.unwrap();
|
||||
model.new_sheet().unwrap();
|
||||
model.set_user_input(2, 1, 1, "=Sheet2!B1").unwrap();
|
||||
|
||||
@@ -39,7 +39,7 @@ fn column_width() {
|
||||
|
||||
// change the column width and check it does not affect the style
|
||||
model
|
||||
.set_column_width(0, 7, DEFAULT_COLUMN_WIDTH * 2.0)
|
||||
.set_columns_width(0, 7, 7, DEFAULT_COLUMN_WIDTH * 2.0)
|
||||
.unwrap();
|
||||
let style = model.get_cell_style(0, 109, 7).unwrap();
|
||||
assert!(style.font.b);
|
||||
@@ -241,7 +241,7 @@ fn width_column_undo() {
|
||||
let mut model = UserModel::new_empty("model", "en", "UTC").unwrap();
|
||||
|
||||
model
|
||||
.set_column_width(0, 7, DEFAULT_COLUMN_WIDTH * 2.0)
|
||||
.set_columns_width(0, 7, 7, DEFAULT_COLUMN_WIDTH * 2.0)
|
||||
.unwrap();
|
||||
|
||||
let column_g_range = Area {
|
||||
@@ -267,7 +267,7 @@ fn width_column_undo() {
|
||||
fn height_row_undo() {
|
||||
let mut model = UserModel::new_empty("model", "en", "UTC").unwrap();
|
||||
model
|
||||
.set_row_height(0, 10, DEFAULT_ROW_HEIGHT * 2.0)
|
||||
.set_rows_height(0, 10, 10, DEFAULT_ROW_HEIGHT * 2.0)
|
||||
.unwrap();
|
||||
|
||||
let row_10_range = Area {
|
||||
@@ -446,7 +446,7 @@ fn column_style_then_width() {
|
||||
.update_range_style(&column_g_range, "fill.bg_color", "#555666")
|
||||
.unwrap();
|
||||
model
|
||||
.set_column_width(0, 7, DEFAULT_COLUMN_WIDTH * 2.0)
|
||||
.set_columns_width(0, 7, 7, DEFAULT_COLUMN_WIDTH * 2.0)
|
||||
.unwrap();
|
||||
|
||||
// Check column width worked:
|
||||
|
||||
@@ -105,7 +105,7 @@ fn delete_column_formatting() {
|
||||
fn column_width() {
|
||||
let mut model = UserModel::new_empty("model", "en", "UTC").unwrap();
|
||||
model
|
||||
.set_column_width(0, 7, DEFAULT_COLUMN_WIDTH * 2.0)
|
||||
.set_columns_width(0, 7, 7, DEFAULT_COLUMN_WIDTH * 2.0)
|
||||
.unwrap();
|
||||
|
||||
let column_g_range = Area {
|
||||
@@ -145,7 +145,7 @@ fn column_width() {
|
||||
fn column_row_style_undo() {
|
||||
let mut model = UserModel::new_empty("model", "en", "UTC").unwrap();
|
||||
model
|
||||
.set_column_width(0, 7, DEFAULT_COLUMN_WIDTH * 2.0)
|
||||
.set_columns_width(0, 7, 7, DEFAULT_COLUMN_WIDTH * 2.0)
|
||||
.unwrap();
|
||||
|
||||
let column_g_range = Area {
|
||||
@@ -228,7 +228,7 @@ fn column_row_row_height_undo() {
|
||||
.unwrap();
|
||||
|
||||
model
|
||||
.set_row_height(0, 3, DEFAULT_ROW_HEIGHT * 2.0)
|
||||
.set_rows_height(0, 3, 3, DEFAULT_ROW_HEIGHT * 2.0)
|
||||
.unwrap();
|
||||
|
||||
model
|
||||
|
||||
@@ -10,7 +10,7 @@ use crate::{
|
||||
fn send_queue() {
|
||||
let mut model1 = UserModel::from_model(new_empty_model());
|
||||
let width = model1.get_column_width(0, 3).unwrap() * 3.0;
|
||||
model1.set_column_width(0, 3, width).unwrap();
|
||||
model1.set_columns_width(0, 3, 3, width).unwrap();
|
||||
model1.set_user_input(0, 1, 2, "Hello IronCalc!").unwrap();
|
||||
let send_queue = model1.flush_send_queue();
|
||||
|
||||
@@ -34,7 +34,7 @@ fn apply_external_diffs_wrong_str() {
|
||||
fn queue_undo_redo() {
|
||||
let mut model1 = UserModel::from_model(new_empty_model());
|
||||
let width = model1.get_column_width(0, 3).unwrap() * 3.0;
|
||||
model1.set_column_width(0, 3, width).unwrap();
|
||||
model1.set_columns_width(0, 3, 3, width).unwrap();
|
||||
model1.set_user_input(0, 1, 2, "Hello IronCalc!").unwrap();
|
||||
assert!(model1.undo().is_ok());
|
||||
assert!(model1.redo().is_ok());
|
||||
@@ -57,8 +57,8 @@ fn queue_undo_redo_multiple() {
|
||||
// do a bunch of things
|
||||
model1.set_frozen_columns_count(0, 5).unwrap();
|
||||
model1.set_frozen_rows_count(0, 6).unwrap();
|
||||
model1.set_column_width(0, 7, 300.0).unwrap();
|
||||
model1.set_row_height(0, 23, 123.0).unwrap();
|
||||
model1.set_columns_width(0, 7, 7, 300.0).unwrap();
|
||||
model1.set_rows_height(0, 23, 23, 123.0).unwrap();
|
||||
model1.set_user_input(0, 55, 55, "=42+8").unwrap();
|
||||
|
||||
for row in 1..5 {
|
||||
|
||||
@@ -59,7 +59,7 @@ fn insert_remove_rows() {
|
||||
// Insert some data in row 5 (and change the style)
|
||||
assert!(model.set_user_input(0, 5, 1, "100$").is_ok());
|
||||
// Change the height of the column
|
||||
assert!(model.set_row_height(0, 5, 3.0 * height).is_ok());
|
||||
assert!(model.set_rows_height(0, 5, 5, 3.0 * height).is_ok());
|
||||
|
||||
// remove the row
|
||||
assert!(model.delete_row(0, 5).is_ok());
|
||||
@@ -95,7 +95,7 @@ fn insert_remove_columns() {
|
||||
// Insert some data in row 5 (and change the style) in E1
|
||||
assert!(model.set_user_input(0, 1, 5, "100$").is_ok());
|
||||
// Change the width of the column
|
||||
assert!(model.set_column_width(0, 5, 3.0 * column_width).is_ok());
|
||||
assert!(model.set_columns_width(0, 5, 5, 3.0 * column_width).is_ok());
|
||||
assert_eq!(model.get_column_width(0, 5).unwrap(), 3.0 * column_width);
|
||||
|
||||
// remove the column
|
||||
|
||||
@@ -59,7 +59,7 @@ fn simple_delete_column() {
|
||||
model.set_user_input(0, 1, 5, "3").unwrap();
|
||||
model.set_user_input(0, 2, 5, "=E1*2").unwrap();
|
||||
model
|
||||
.set_column_width(0, 5, DEFAULT_COLUMN_WIDTH * 3.0)
|
||||
.set_columns_width(0, 5, 5, DEFAULT_COLUMN_WIDTH * 3.0)
|
||||
.unwrap();
|
||||
|
||||
model.delete_column(0, 5).unwrap();
|
||||
@@ -116,7 +116,7 @@ fn simple_delete_row() {
|
||||
model.set_user_input(0, 15, 6, "=D15*2").unwrap();
|
||||
|
||||
model
|
||||
.set_row_height(0, 15, DEFAULT_ROW_HEIGHT * 3.0)
|
||||
.set_rows_height(0, 15, 15, DEFAULT_ROW_HEIGHT * 3.0)
|
||||
.unwrap();
|
||||
|
||||
model.delete_row(0, 15).unwrap();
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::{test::util::new_empty_model, UserModel};
|
||||
fn basic() {
|
||||
let mut model1 = UserModel::from_model(new_empty_model());
|
||||
let width = model1.get_column_width(0, 3).unwrap() * 3.0;
|
||||
model1.set_column_width(0, 3, width).unwrap();
|
||||
model1.set_columns_width(0, 3, 3, width).unwrap();
|
||||
model1.set_user_input(0, 1, 2, "Hello IronCalc!").unwrap();
|
||||
|
||||
let model_bytes = model1.to_bytes();
|
||||
|
||||
Reference in New Issue
Block a user