Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DESKTOP-U434MT0\hiro committed Aug 4, 2024
1 parent 51a8f36 commit 45714e1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "umya-spreadsheet"
version = "2.0.0"
version = "2.0.1"
authors = ["MathNya <[email protected]>"]
repository = "https://github.com/MathNya/umya-spreadsheet"
keywords = ["excel", "spreadsheet", "xlsx", "reader", "writer"]
Expand Down
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,18 @@
Please mention in issues if you have any questions.

## Update details
### ver 2.0.0
* Revised version 1.3.0 to version 2.0.0.
* **[Breaking changes]** The multiple error structures are now combined in structs/error.rs.
* **[Breaking changes]** Flexible error settings in cell_value.rs.
* **[Breaking changes]** For details on other modifications, please click [here](https://github.com/MathNya/umya-spreadsheet/blob/master/CHANGELOG.md#Change-Detail-v127--v200).
* Formula positions are now recalculated when columns or rows are added or deleted.
* Stronger Error Types implementation. (Thank you, [agentjill](https://github.com/agentjill).)
* Fixed problems with reading and writing sheets containing images.
* Other minor bug fix.
### ver 2.0.1
* Minor bug fixes

## Usage
### Installation
Add the following code to Cargo.toml
```toml
[dependencies]
umya-spreadsheet = "1.3.0"
umya-spreadsheet = "2.0.1"

# WebAssembly support
umya-spreadsheet = { version = "1.3.0", features = ["js"] }
umya-spreadsheet = { version = "2.0.1", features = ["js"] }
```

Add the following code to main.rs
Expand Down
1 change: 0 additions & 1 deletion src/structs/cell_raw_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ impl CellRawValue {
match self {
Self::String(_) | // _
Self::Numeric(_) | // _
Self::RichText(_) | // _
Self::Bool(_) => {
let mut text = Text::default();
text.set_value(self.to_string());
Expand Down
10 changes: 1 addition & 9 deletions src/structs/shared_string_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ impl SharedStringTable {
self.regist_count += 1;

let mut shared_string_item = SharedStringItem::default();

if let Some(v) = value.get_text() {
shared_string_item.set_text(v);
}
Expand Down Expand Up @@ -74,15 +75,6 @@ impl SharedStringTable {
let mut shared_string_item = SharedStringItem::default();
shared_string_item.set_attributes(reader, e);

// set ThemeColor
if let Some(v) = shared_string_item.get_rich_text_mut() {
for element in v.get_rich_text_elements_mut() {
if let Some(r) = element.get_run_properties_crate() {
let color = r.get_color_mut();
}
}
}

let hash_code = shared_string_item.get_hash_u64();
self.map.insert(hash_code, n);
self.set_shared_string_item(shared_string_item);
Expand Down
24 changes: 16 additions & 8 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn read_large_string() {
// reader
let path = std::path::Path::new("./tests/test_files/aaa_large_string.xlsx");
let mut book = umya_spreadsheet::reader::xlsx::lazy_read(path).unwrap();
let _ns = book.get_sheet_by_name_mut("Sheet1").unwrap();
//let _ns = book.get_sheet_by_name_mut("Sheet1").unwrap();
}

#[test]
Expand Down Expand Up @@ -1588,13 +1588,21 @@ fn issue_210() {
let vertical = varA.get_vertical().get_value_string();
let rot = varA.get_text_rotation();
let wrap = varA.get_wrap_text();
dbg!(vec![
cell.get_coordinate().to_string(),
horizontal.to_string(),
vertical.to_string(),
rot.to_string(),
wrap.to_string()
]);
// dbg!(vec![
// cell.get_coordinate().to_string(),
// horizontal.to_string(),
// vertical.to_string(),
// rot.to_string(),
// wrap.to_string()
//]);
}
}
}

#[test]
fn issue_208() {
let path = std::path::Path::new("./tests/test_files/issue_208.xlsx");
let mut book = umya_spreadsheet::reader::xlsx::read(path).unwrap();
let path = std::path::Path::new("./tests/result_files/issue_208.xlsx");
let _ = umya_spreadsheet::writer::xlsx::write(&book, path);
}
Binary file added tests/test_files/issue_208.xlsx
Binary file not shown.

0 comments on commit 45714e1

Please sign in to comment.