fix: disable bool el (#811)
parent
a4c38a7b0e
commit
6c1d6e89b2
|
@ -40,6 +40,10 @@ impl BuildXML for Bold {
|
||||||
&self,
|
&self,
|
||||||
stream: xml::writer::EventWriter<W>,
|
stream: xml::writer::EventWriter<W>,
|
||||||
) -> xml::writer::Result<xml::writer::EventWriter<W>> {
|
) -> xml::writer::Result<xml::writer::EventWriter<W>> {
|
||||||
XMLBuilder::from(stream).b()?.into_inner()
|
if self.val {
|
||||||
|
XMLBuilder::from(stream).b()?.into_inner()
|
||||||
|
} else {
|
||||||
|
XMLBuilder::from(stream).disable_bold()?.into_inner()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,10 @@ impl BuildXML for Dstrike {
|
||||||
&self,
|
&self,
|
||||||
stream: xml::writer::EventWriter<W>,
|
stream: xml::writer::EventWriter<W>,
|
||||||
) -> xml::writer::Result<xml::writer::EventWriter<W>> {
|
) -> xml::writer::Result<xml::writer::EventWriter<W>> {
|
||||||
XMLBuilder::from(stream).dstrike()?.into_inner()
|
if self.val {
|
||||||
|
XMLBuilder::from(stream).dstrike()?.into_inner()
|
||||||
|
} else {
|
||||||
|
XMLBuilder::from(stream).disable_dstrike()?.into_inner()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,10 @@ impl BuildXML for Italic {
|
||||||
&self,
|
&self,
|
||||||
stream: xml::writer::EventWriter<W>,
|
stream: xml::writer::EventWriter<W>,
|
||||||
) -> xml::writer::Result<xml::writer::EventWriter<W>> {
|
) -> xml::writer::Result<xml::writer::EventWriter<W>> {
|
||||||
XMLBuilder::from(stream).i()?.into_inner()
|
if self.val {
|
||||||
|
XMLBuilder::from(stream).i()?.into_inner()
|
||||||
|
} else {
|
||||||
|
XMLBuilder::from(stream).disable_italic()?.into_inner()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,10 @@ impl BuildXML for Strike {
|
||||||
&self,
|
&self,
|
||||||
stream: xml::writer::EventWriter<W>,
|
stream: xml::writer::EventWriter<W>,
|
||||||
) -> xml::writer::Result<xml::writer::EventWriter<W>> {
|
) -> xml::writer::Result<xml::writer::EventWriter<W>> {
|
||||||
XMLBuilder::from(stream).strike()?.into_inner()
|
if self.val {
|
||||||
|
XMLBuilder::from(stream).strike()?.into_inner()
|
||||||
|
} else {
|
||||||
|
XMLBuilder::from(stream).disable_strike()?.into_inner()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,14 +183,39 @@ impl<W: Write> XMLBuilder<W> {
|
||||||
closed!(b, "w:b");
|
closed!(b, "w:b");
|
||||||
closed!(b_cs, "w:bCs");
|
closed!(b_cs, "w:bCs");
|
||||||
|
|
||||||
|
pub(crate) fn disable_bold(self) -> Result<Self> {
|
||||||
|
let f = "false";
|
||||||
|
self.write(XmlEvent::start_element("w:b").attr("w:val", &f))?
|
||||||
|
.close()
|
||||||
|
}
|
||||||
|
|
||||||
closed_with_str!(caps, "w:caps");
|
closed_with_str!(caps, "w:caps");
|
||||||
|
|
||||||
closed!(i, "w:i");
|
closed!(i, "w:i");
|
||||||
closed!(i_cs, "w:iCs");
|
closed!(i_cs, "w:iCs");
|
||||||
|
|
||||||
|
pub(crate) fn disable_italic(self) -> Result<Self> {
|
||||||
|
let f = "false";
|
||||||
|
self.write(XmlEvent::start_element("w:i").attr("w:val", &f))?
|
||||||
|
.close()
|
||||||
|
}
|
||||||
|
|
||||||
closed!(strike, "w:strike");
|
closed!(strike, "w:strike");
|
||||||
|
|
||||||
|
pub(crate) fn disable_strike(self) -> Result<Self> {
|
||||||
|
let f = "false";
|
||||||
|
self.write(XmlEvent::start_element("w:strike").attr("w:val", &f))?
|
||||||
|
.close()
|
||||||
|
}
|
||||||
|
|
||||||
closed!(dstrike, "w:dstrike");
|
closed!(dstrike, "w:dstrike");
|
||||||
|
|
||||||
|
pub(crate) fn disable_dstrike(self) -> Result<Self> {
|
||||||
|
let f = "false";
|
||||||
|
self.write(XmlEvent::start_element("w:dstrike").attr("w:val", &f))?
|
||||||
|
.close()
|
||||||
|
}
|
||||||
|
|
||||||
// Build w:style element
|
// Build w:style element
|
||||||
// i.e. <w:style ... >
|
// i.e. <w:style ... >
|
||||||
pub(crate) fn open_style(self, style_type: StyleType, id: &str) -> Result<Self> {
|
pub(crate) fn open_style(self, style_type: StyleType, id: &str) -> Result<Self> {
|
||||||
|
@ -471,7 +496,7 @@ impl<W: Write> XMLBuilder<W> {
|
||||||
closed!(keep_lines, "w:keepLines");
|
closed!(keep_lines, "w:keepLines");
|
||||||
closed!(page_break_before, "w:pageBreakBefore");
|
closed!(page_break_before, "w:pageBreakBefore");
|
||||||
closed!(widow_control, "w:widowControl", "w:val");
|
closed!(widow_control, "w:widowControl", "w:val");
|
||||||
closed!(bidi,"w:bidi");
|
closed!(bidi, "w:bidi");
|
||||||
/*
|
/*
|
||||||
<w:lvlOverride w:ilvl="0">
|
<w:lvlOverride w:ilvl="0">
|
||||||
<w:startOverride w:val="1"/>
|
<w:startOverride w:val="1"/>
|
||||||
|
|
Loading…
Reference in New Issue