fix: disable bool el (#811)
parent
a4c38a7b0e
commit
6c1d6e89b2
|
@ -40,6 +40,10 @@ impl BuildXML for Bold {
|
|||
&self,
|
||||
stream: xml::writer::EventWriter<W>,
|
||||
) -> xml::writer::Result<xml::writer::EventWriter<W>> {
|
||||
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,
|
||||
stream: xml::writer::EventWriter<W>,
|
||||
) -> xml::writer::Result<xml::writer::EventWriter<W>> {
|
||||
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,
|
||||
stream: xml::writer::EventWriter<W>,
|
||||
) -> xml::writer::Result<xml::writer::EventWriter<W>> {
|
||||
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,
|
||||
stream: xml::writer::EventWriter<W>,
|
||||
) -> xml::writer::Result<xml::writer::EventWriter<W>> {
|
||||
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_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!(i, "w:i");
|
||||
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");
|
||||
|
||||
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");
|
||||
|
||||
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
|
||||
// i.e. <w:style ... >
|
||||
pub(crate) fn open_style(self, style_type: StyleType, id: &str) -> Result<Self> {
|
||||
|
|
Loading…
Reference in New Issue