parent
2f1cd0d127
commit
7a13d159d2
|
@ -128,7 +128,7 @@ impl Run {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn spacing(mut self, v: u32) -> Run {
|
pub fn spacing(mut self, v: i32) -> Run {
|
||||||
self.run_property = self.run_property.spacing(v);
|
self.run_property = self.run_property.spacing(v);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ pub struct RunProperty {
|
||||||
pub italic: Option<Italic>,
|
pub italic: Option<Italic>,
|
||||||
pub italic_cs: Option<ItalicCs>,
|
pub italic_cs: Option<ItalicCs>,
|
||||||
pub vanish: Option<Vanish>,
|
pub vanish: Option<Vanish>,
|
||||||
pub spacing: Option<u32>,
|
pub spacing: Option<i32>,
|
||||||
pub fonts: Option<RunFonts>,
|
pub fonts: Option<RunFonts>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,8 +32,8 @@ impl RunProperty {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn spacing(mut self, spacing: u32) -> RunProperty {
|
pub fn spacing(mut self, spacing: i32) -> RunProperty {
|
||||||
self.spacing = Some(spacing as u32);
|
self.spacing = Some(spacing);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ impl ElementReader for RunProperty {
|
||||||
XMLElement::Size => rp = rp.size(usize::from_str(&attributes[0].value)?),
|
XMLElement::Size => rp = rp.size(usize::from_str(&attributes[0].value)?),
|
||||||
XMLElement::Spacing => {
|
XMLElement::Spacing => {
|
||||||
if let Some(v) = read_val(&attributes) {
|
if let Some(v) = read_val(&attributes) {
|
||||||
rp = rp.spacing(u32::from_str(&v)?)
|
rp = rp.spacing(f32::from_str(&v)? as i32)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
XMLElement::Underline => rp = rp.underline(&attributes[0].value.clone()),
|
XMLElement::Underline => rp = rp.underline(&attributes[0].value.clone()),
|
||||||
|
|
|
@ -3,7 +3,7 @@ use serde::*;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Deserialize)]
|
#[derive(Copy, Clone, Debug, PartialEq, Deserialize)]
|
||||||
pub enum SpacingType {
|
pub enum SpacingType {
|
||||||
Value(u32),
|
Value(i32),
|
||||||
Line(u32),
|
Line(u32),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "docx-wasm",
|
"name": "docx-wasm",
|
||||||
"version": "0.0.113",
|
"version": "0.0.114",
|
||||||
"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>",
|
||||||
|
|
|
@ -80,7 +80,7 @@ impl Run {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn spacing(mut self, spacing: u32) -> Run {
|
pub fn spacing(mut self, spacing: i32) -> Run {
|
||||||
self.0.run_property = self.0.run_property.spacing(spacing);
|
self.0.run_property = self.0.run_property.spacing(spacing);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue