Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some changes #236

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ cbc = "0.1.2"
cfb = "0.10.0"
chrono = { version = "0.4.31", default-features = false, features = ["clock"] }
encoding_rs = "0.8.33"
fancy-regex = "0.13.0"
fancy-regex = "0.14.0"
getrandom = { version = "0.2.14" }
hashbrown = "0.14.3"
hashbrown = "0.14.5"
hmac = "0.12.1"
html_parser = "0.7.0"
image = { version = "0.25.0", optional = true }
lazy_static = "1.4.0"
md-5 = "0.10.6"
regex = "1.10.2"
regex = "1.11.1"
sha2 = "0.10.8"
thousands = "0.2.0"
quick-xml = { version = "0.35.0", features = ["serialize"] }
quick-xml = { version = "0.36.2", features = ["serialize"] }
zip = { version = "1.1.4", default-features = false, features = ["deflate"] }

[lib]
Expand Down
4 changes: 2 additions & 2 deletions src/structs/true_false_blank_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ impl TrueFalseBlankValue {
}

pub(crate) fn set_value_string<S: Into<String>>(&mut self, value: S) -> &mut Self {
let value_str = value.into();
self.set_value(!(&value_str == "f" || &value_str == "False"))
let value = value.into();
self.set_value(!(value.eq_ignore_ascii_case("f") || value.eq_ignore_ascii_case("false")))
}

pub(crate) fn has_value(&self) -> bool {
Expand Down
8 changes: 6 additions & 2 deletions src/structs/true_false_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ impl TrueFalseValue {
}

pub(crate) fn get_value_string(&self) -> &str {
self.value.as_ref().map_or("f", |b| "t")
match self.get_value() {
true => "t",
false => "f",
}
}

pub(crate) fn set_value(&mut self, value: bool) -> &mut Self {
Expand All @@ -18,7 +21,8 @@ impl TrueFalseValue {
}

pub(crate) fn set_value_string<S: Into<String>>(&mut self, value: S) -> &mut Self {
self.set_value(value.into() != "f")
let value: String = value.into();
self.set_value(!(value.eq_ignore_ascii_case("f") || value.eq_ignore_ascii_case("false")))
}

pub(crate) fn has_value(&self) -> bool {
Expand Down
16 changes: 7 additions & 9 deletions src/structs/worksheet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1778,19 +1778,17 @@ impl AdjustmentCoordinate for Worksheet {
}

// defined_names
let mut idx = 0 as usize;
while idx < self.defined_names.len() {
if self.defined_names[idx].is_remove_coordinate_with_sheet(
&self.title,
let title = &self.title;
self.defined_names.retain(|defined_name| {
!defined_name.is_remove_coordinate_with_sheet(
&title,
root_col_num,
offset_col_num,
root_row_num,
offset_row_num,
) {
self.defined_names.remove(idx);
}
idx += 1;
}
)
});

for defined_name in &mut self.defined_names {
defined_name.adjustment_remove_coordinate_with_sheet(
&self.title,
Expand Down