2019-11-06 12:17:49 +02:00
|
|
|
use crate::documents::BuildXML;
|
|
|
|
use crate::xml_builder::*;
|
|
|
|
|
2019-11-07 11:45:03 +02:00
|
|
|
#[derive(Debug)]
|
2019-11-06 12:17:49 +02:00
|
|
|
pub struct ParagraphProperty {}
|
|
|
|
|
|
|
|
// 17.3.1.26
|
|
|
|
// pPr (Paragraph Properties)
|
|
|
|
// This element specifies a set of paragraph properties which shall be applied to the contents of the parent
|
|
|
|
// paragraph after all style/numbering/table properties have been applied to the text. These properties are defined
|
|
|
|
// as direct formatting, since they are directly applied to the paragraph and supersede any formatting from styles.
|
|
|
|
impl ParagraphProperty {
|
|
|
|
pub fn new() -> ParagraphProperty {
|
|
|
|
ParagraphProperty {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl BuildXML for ParagraphProperty {
|
|
|
|
fn build(&self) -> Vec<u8> {
|
|
|
|
let b = XMLBuilder::new();
|
|
|
|
b.open_paragraph_property().close().build()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
|
|
|
|
|
|
|
use super::*;
|
2019-11-07 06:57:58 +02:00
|
|
|
#[cfg(test)]
|
|
|
|
use pretty_assertions::assert_eq;
|
2019-11-06 12:17:49 +02:00
|
|
|
use std::str;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_build() {
|
|
|
|
let c = ParagraphProperty::new();
|
|
|
|
let b = c.build();
|
|
|
|
assert_eq!(str::from_utf8(&b).unwrap(), r#"<w:pPr />"#);
|
|
|
|
}
|
|
|
|
}
|