fix: spacing type (#644)

* fix: spacing type

* fix
main
bokuweb 2023-08-10 18:09:52 +09:00 committed by GitHub
parent 64a1b05a22
commit d901842d51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 7 deletions

View File

@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## docx-wasm@0.0.278-rc19 (9. Aug, 2023)
- use i32 for line instead of u32.
## docx-wasm@0.0.278-rc18 (24. Jul, 2023)
- read caps.
## docx-wasm@0.0.278-rc16 (14. Jul, 2023) ## docx-wasm@0.0.278-rc16 (14. Jul, 2023)
- Improve read numbering types. - Improve read numbering types.

View File

@ -18,7 +18,7 @@ pub struct LineSpacing {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
after_lines: Option<u32>, after_lines: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
line: Option<u32>, line: Option<i32>,
} }
impl LineSpacing { impl LineSpacing {
@ -51,8 +51,8 @@ impl LineSpacing {
self self
} }
pub fn line(mut self, line: u32) -> Self { pub fn line(mut self, line: i32) -> Self {
self.line = Some(line); self.line = Some(line as i32);
self self
} }
} }

View File

@ -16,7 +16,7 @@ pub fn read_line_spacing(attributes: &[OwnedAttribute]) -> Result<LineSpacing, R
spacing = spacing.after(f64::from_str(&a.value)? as u32); spacing = spacing.after(f64::from_str(&a.value)? as u32);
} }
"line" => { "line" => {
spacing = spacing.line(f64::from_str(&a.value)? as u32); spacing = spacing.line(f64::from_str(&a.value)? as i32);
} }
"lineRule" => { "lineRule" => {
spacing = spacing.line_rule(LineSpacingType::from_str(&a.value)?); spacing = spacing.line_rule(LineSpacingType::from_str(&a.value)?);

View File

@ -253,7 +253,7 @@ impl XMLBuilder {
mut self, mut self,
before: Option<u32>, before: Option<u32>,
after: Option<u32>, after: Option<u32>,
line: Option<u32>, line: Option<i32>,
before_lines: Option<u32>, before_lines: Option<u32>,
after_lines: Option<u32>, after_lines: Option<u32>,
spacing: Option<LineSpacingType>, spacing: Option<LineSpacingType>,

View File

@ -1,6 +1,6 @@
{ {
"name": "docx-wasm", "name": "docx-wasm",
"version": "0.0.278-rc18", "version": "0.0.278-rc19",
"main": "dist/node/index.js", "main": "dist/node/index.js",
"browser": "dist/web/index.js", "browser": "dist/web/index.js",
"author": "bokuweb <bokuweb12@gmail.com>", "author": "bokuweb <bokuweb12@gmail.com>",

View File

@ -43,7 +43,7 @@ impl LineSpacing {
} }
pub fn line(mut self, line: u32) -> Self { pub fn line(mut self, line: u32) -> Self {
self.0 = self.0.line(line); self.0 = self.0.line(line as i32);
self self
} }
} }