mod border;
mod color;
mod frame;
mod paragraph;
mod place;
mod run;
#[cfg(test)]
mod tests;
#[cfg(test)]
pub use border::BorderParts;
pub use border::{ArtStyle, Border, Borders, DashStyle, NamedSides};
pub(crate) use border::{
BORDER_NAMES, Gap, LineStyle, Relief, read_border, read_border_as, read_line_style,
read_table_border,
};
pub use color::{Color, WHITE};
pub(crate) use color::{parse_color, read_page_color, read_shading, shows_shading};
pub use frame::{FrameMark, FramePr, FrameWrap};
pub use paragraph::{
Alignment, HtmlAutoSpacing, Kashidas, LineSpacing, ListLevel, ListRef, MarkChange, ParaProps,
TabKind, TabStop, TextAlignment,
};
pub(crate) use place::{ANCHOR, X_ALIGN, XAlign, Y_ALIGN, YAlign};
pub use place::{Align, Anchor};
pub(crate) use run::UNDERLINE;
pub use run::{
BidiLanguageClass, CodeFormat, EastAsianScript, FontRef, Limit, MathScript, MathStep,
MathStyle, OutlineColor, RunProps, Strike, TextFill, TextOutline, TextShadow, Underline,
VerticalAlign,
};
#[cfg(test)]
pub use run::{BidiScript, TextEffect, UnsupportedProperty};
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SetIn<T> {
pub value: T,
pub part: std::rc::Rc<f_office_warnings::Name>,
}
impl<T> SetIn<T> {
pub(crate) fn read(value: T, reader: &crate::reader::PartReader) -> Self {
Self {
value,
part: std::rc::Rc::new(f_office_warnings::Name::new(reader.part())),
}
}
}
pub(crate) fn value_of<T: Copy>(set: Option<&SetIn<T>>) -> Option<T> {
set.map(|set| set.value)
}
pub(crate) fn overlay<T: Clone>(target: &mut Option<T>, source: Option<&T>) {
if let Some(value) = source {
*target = Some(value.clone());
}
}