use super::paragraph::Paragraph;
use super::style::{Fill, ShapeBorderLine};
use super::*;
pub(crate) mod shadow;
pub(crate) mod common_obj_offsets {
pub const FLAGS: std::ops::Range<usize> = 0..4;
pub const V_OFFSET: std::ops::Range<usize> = 4..8;
pub const H_OFFSET: std::ops::Range<usize> = 8..12;
pub const WIDTH: std::ops::Range<usize> = 12..16;
pub const HEIGHT: std::ops::Range<usize> = 16..20;
pub const Z_ORDER: std::ops::Range<usize> = 20..24;
pub const MARGIN_LEFT: std::ops::Range<usize> = 24..26;
pub const MARGIN_RIGHT: std::ops::Range<usize> = 26..28;
pub const MARGIN_TOP: std::ops::Range<usize> = 28..30;
pub const MARGIN_BOTTOM: std::ops::Range<usize> = 30..32;
pub const INSTANCE_ID: std::ops::Range<usize> = 32..36;
pub const PREVENT_PAGE_BREAK: std::ops::Range<usize> = 36..40;
pub const MIN_LEN: usize = INSTANCE_ID.end;
pub const MIN_LEN_WITH_PREVENT_PAGE_BREAK: usize = PREVENT_PAGE_BREAK.end;
}
#[derive(Debug, Clone, Default, serde::Serialize)]
pub struct CommonObjAttr {
#[serde(skip_serializing_if = "std::ops::Not::not")]
pub cell_frame_paint: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub cell_border_paint: Option<super::border_paint::CellBorderPaint>,
#[serde(skip_serializing_if = "Option::is_none")]
pub outside_cell_border_paint: Option<super::border_paint::OutsideCellBorderPaint>,
pub ctrl_id: u32,
pub attr: u32,
pub vertical_offset: HwpUnit,
pub horizontal_offset: HwpUnit,
pub width: HwpUnit,
pub height: HwpUnit,
pub z_order: i32,
pub margin: Padding,
pub instance_id: u32,
pub prevent_page_break: i32,
pub treat_as_char: bool,
pub flow_with_text: bool,
pub allow_overlap: bool,
pub affect_line_spacing: bool,
pub size_protect: bool,
pub hwp5_gen_shape_attr_bit28: bool,
pub vert_rel_to: VertRelTo,
pub vert_align: VertAlign,
pub horz_rel_to: HorzRelTo,
pub horz_align: HorzAlign,
pub text_wrap: TextWrap,
pub text_flow: TextFlow,
pub width_criterion: SizeCriterion,
pub height_criterion: SizeCriterion,
pub description: String,
pub numbering_type: ObjectNumberingType,
pub drop_cap_style: DropCapStyle,
pub raw_extra: Vec<u8>,
pub locked: bool,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
pub enum ObjectNumberingType {
#[default]
None,
Picture,
Table,
Equation,
}
impl ObjectNumberingType {
pub const HWP5_ATTR_MASK: u32 = 0x03 << 26;
pub fn from_hwp5_attr(attr: u32) -> Self {
match (attr >> 26) & 0x03 {
1 => Self::Picture,
2 => Self::Table,
3 => Self::Equation,
_ => Self::None,
}
}
pub fn hwp5_attr_bits(self) -> u32 {
(match self {
Self::None => 0,
Self::Picture => 1,
Self::Table => 2,
Self::Equation => 3,
}) << 26
}
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
pub enum DropCapStyle {
#[default]
None,
DoubleLine,
TripleLine,
Margin,
}
impl DropCapStyle {
const HWP5_CTRL_DATA_PREFIX: [u8; 20] = [
0x1b, 0x02, 0x01, 0x00, 0x00, 0x00, 0x03, 0x30, 0x00, 0x80, 0x03, 0x30, 0x01, 0x00, 0x00,
0x00, 0x01, 0x70, 0x09, 0x00,
];
pub fn from_hwp5_ctrl_data(data: &[u8]) -> Option<Self> {
let (prefix, value) = data.split_at_checked(Self::HWP5_CTRL_DATA_PREFIX.len())?;
if prefix != Self::HWP5_CTRL_DATA_PREFIX {
return None;
}
match u32::from_le_bytes(value.try_into().ok()?) {
1 => Some(Self::DoubleLine),
2 => Some(Self::TripleLine),
3 => Some(Self::Margin),
_ => None,
}
}
pub fn hwp5_ctrl_data(self) -> Option<[u8; 24]> {
let value: u32 = match self {
Self::None => return None,
Self::DoubleLine => 1,
Self::TripleLine => 2,
Self::Margin => 3,
};
let mut data = [0; 24];
data[..20].copy_from_slice(&Self::HWP5_CTRL_DATA_PREFIX);
data[20..].copy_from_slice(&value.to_le_bytes());
Some(data)
}
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
pub enum VertRelTo {
#[default]
Paper,
Page,
Para,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
pub enum VertAlign {
#[default]
Top,
Center,
Bottom,
Inside,
Outside,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
pub enum HorzRelTo {
#[default]
Paper,
Page,
Column,
Para,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
pub enum HorzAlign {
#[default]
Left,
Center,
Right,
Inside,
Outside,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
pub enum SizeCriterion {
Paper,
Page,
Column,
Para,
#[default]
Absolute,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
pub enum TextWrap {
#[default]
Square,
Tight,
Through,
TopAndBottom,
BehindText,
InFrontOfText,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
pub enum TextFlow {
#[default]
BothSides,
LeftOnly,
RightOnly,
LargestOnly,
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ShapeComponentAttr {
pub ctrl_id: u32,
pub is_two_ctrl_id: bool,
pub offset_x: i32,
pub offset_y: i32,
pub group_level: u16,
pub local_file_version: u16,
pub original_width: u32,
pub original_height: u32,
pub original_width_was_zero: bool,
pub original_height_was_zero: bool,
pub current_width: u32,
pub current_height: u32,
pub current_width_was_zero: bool,
pub current_height_was_zero: bool,
pub flip: u32,
pub horz_flip: bool,
pub vert_flip: bool,
pub rotation_angle: HwpUnit16,
pub rotate_image: bool,
pub rotation_center: Point,
pub raw_rendering: Vec<u8>,
pub render_tx: f64,
pub render_ty: f64,
pub render_sx: f64,
pub render_sy: f64,
pub render_b: f64,
pub render_c: f64,
#[serde(skip)]
pub ctrl_data: Option<Vec<u8>>,
}
impl ShapeComponentAttr {
pub(crate) fn local_reflection_matrix(&self) -> [f64; 6] {
[
if self.horz_flip { -1.0 } else { 1.0 },
0.0,
if self.horz_flip {
self.original_width as f64
} else {
0.0
},
0.0,
if self.vert_flip { -1.0 } else { 1.0 },
if self.vert_flip {
self.original_height as f64
} else {
0.0
},
]
}
}
impl Default for ShapeComponentAttr {
fn default() -> Self {
Self {
ctrl_id: 0,
is_two_ctrl_id: false,
offset_x: 0,
offset_y: 0,
group_level: 0,
local_file_version: 0,
original_width: 0,
original_height: 0,
original_width_was_zero: false,
original_height_was_zero: false,
current_width: 0,
current_height: 0,
current_width_was_zero: false,
current_height_was_zero: false,
flip: 0,
horz_flip: false,
vert_flip: false,
rotation_angle: 0,
rotate_image: false,
rotation_center: Point::default(),
raw_rendering: Vec::new(),
render_tx: 0.0,
render_ty: 0.0,
render_sx: 1.0,
render_sy: 1.0,
render_b: 0.0,
render_c: 0.0,
ctrl_data: None,
}
}
}
impl ShapeComponentAttr {
pub(crate) fn has_saved_affine_geometry(&self) -> bool {
let matrix = [
self.render_sx,
self.render_b,
self.render_tx,
self.render_c,
self.render_sy,
self.render_ty,
];
!self.raw_rendering.is_empty()
&& matrix.iter().all(|v| v.is_finite())
&& self.render_sx * self.render_sy - self.render_b * self.render_c != 0.0
&& matrix != [1.0, 0.0, 0.0, 0.0, 1.0, 0.0]
}
}
#[derive(Debug, Default, Clone, serde::Serialize)]
pub struct DrawingObjAttr {
pub shape_attr: ShapeComponentAttr,
pub border_line: ShapeBorderLine,
pub fill: Fill,
pub shadow_type: u32,
pub shadow_color: u32,
pub shadow_offset_x: i32,
pub shadow_offset_y: i32,
pub inst_id: u32,
pub shadow_alpha: u8,
pub text_box: Option<TextBox>,
pub caption: Option<Caption>,
}
impl DrawingObjAttr {
pub const TEXT_BOX_STORAGE_BIT: u32 = 0x0100_0000;
pub fn sync_text_box_storage_bit(&mut self) {
if self.text_box.is_some() {
self.shape_attr.flip |= Self::TEXT_BOX_STORAGE_BIT;
} else {
self.shape_attr.flip &= !Self::TEXT_BOX_STORAGE_BIT;
}
}
}
#[derive(Debug, Default, Clone, serde::Serialize)]
pub struct TextBox {
#[serde(skip_serializing_if = "Option::is_none")]
pub paint_clip: Option<Vec<super::text_clip::TextClipPath>>,
pub list_attr: u32,
pub vertical_all: bool,
pub vertical_align: crate::model::table::VerticalAlign,
pub margin_left: HwpUnit16,
pub margin_right: HwpUnit16,
pub margin_top: HwpUnit16,
pub margin_bottom: HwpUnit16,
#[serde(skip_serializing_if = "std::ops::Not::not")]
pub text_margin_explicit: bool,
pub max_width: HwpUnit,
pub raw_list_header_extra: Vec<u8>,
pub paragraphs: Vec<Paragraph>,
}
#[derive(Debug, Clone, serde::Serialize)]
pub enum ShapeObject {
Line(LineShape),
Rectangle(RectangleShape),
Ellipse(EllipseShape),
Arc(ArcShape),
Polygon(PolygonShape),
Curve(CurveShape),
Group(GroupShape),
Picture(Box<crate::model::image::Picture>),
Chart(Box<ChartShape>),
Ole(Box<OleShape>),
}
impl ShapeObject {
pub fn common(&self) -> &CommonObjAttr {
match self {
ShapeObject::Line(s) => &s.common,
ShapeObject::Rectangle(s) => &s.common,
ShapeObject::Ellipse(s) => &s.common,
ShapeObject::Arc(s) => &s.common,
ShapeObject::Polygon(s) => &s.common,
ShapeObject::Curve(s) => &s.common,
ShapeObject::Group(g) => &g.common,
ShapeObject::Picture(p) => &p.common,
ShapeObject::Chart(c) => &c.common,
ShapeObject::Ole(o) => &o.common,
}
}
pub fn common_mut(&mut self) -> &mut CommonObjAttr {
match self {
ShapeObject::Line(s) => &mut s.common,
ShapeObject::Rectangle(s) => &mut s.common,
ShapeObject::Ellipse(s) => &mut s.common,
ShapeObject::Arc(s) => &mut s.common,
ShapeObject::Polygon(s) => &mut s.common,
ShapeObject::Curve(s) => &mut s.common,
ShapeObject::Group(g) => &mut g.common,
ShapeObject::Picture(p) => &mut p.common,
ShapeObject::Chart(c) => &mut c.common,
ShapeObject::Ole(o) => &mut o.common,
}
}
pub fn drawing(&self) -> Option<&DrawingObjAttr> {
match self {
ShapeObject::Line(s) => Some(&s.drawing),
ShapeObject::Rectangle(s) => Some(&s.drawing),
ShapeObject::Ellipse(s) => Some(&s.drawing),
ShapeObject::Arc(s) => Some(&s.drawing),
ShapeObject::Polygon(s) => Some(&s.drawing),
ShapeObject::Curve(s) => Some(&s.drawing),
ShapeObject::Chart(c) => Some(&c.drawing),
ShapeObject::Ole(o) => Some(&o.drawing),
ShapeObject::Group(_) | ShapeObject::Picture(_) => None,
}
}
pub fn drawing_mut(&mut self) -> Option<&mut DrawingObjAttr> {
match self {
ShapeObject::Line(s) => Some(&mut s.drawing),
ShapeObject::Rectangle(s) => Some(&mut s.drawing),
ShapeObject::Ellipse(s) => Some(&mut s.drawing),
ShapeObject::Arc(s) => Some(&mut s.drawing),
ShapeObject::Polygon(s) => Some(&mut s.drawing),
ShapeObject::Curve(s) => Some(&mut s.drawing),
ShapeObject::Chart(c) => Some(&mut c.drawing),
ShapeObject::Ole(o) => Some(&mut o.drawing),
ShapeObject::Group(_) | ShapeObject::Picture(_) => None,
}
}
pub fn textbox_shape_count(&self) -> usize {
match self {
Self::Group(group) => group.children.iter().map(Self::textbox_shape_count).sum(),
_ => usize::from(
self.drawing()
.is_some_and(|drawing| drawing.text_box.is_some()),
),
}
}
pub fn textbox_shape_at(&self, mut index: usize) -> Option<&Self> {
if let Self::Group(group) = self {
for child in &group.children {
let count = child.textbox_shape_count();
if index < count {
return child.textbox_shape_at(index);
}
index -= count;
}
None
} else {
(index == 0 && self.textbox_shape_count() == 1).then_some(self)
}
}
pub fn textbox_shape_at_mut(&mut self, mut index: usize) -> Option<&mut Self> {
if let Self::Group(group) = self {
for child in &mut group.children {
let count = child.textbox_shape_count();
if index < count {
return child.textbox_shape_at_mut(index);
}
index -= count;
}
None
} else if index == 0
&& self
.drawing()
.is_some_and(|drawing| drawing.text_box.is_some())
{
Some(self)
} else {
None
}
}
pub fn z_order(&self) -> i32 {
self.common().z_order
}
pub fn shape_attr(&self) -> &ShapeComponentAttr {
match self {
ShapeObject::Line(s) => &s.drawing.shape_attr,
ShapeObject::Rectangle(s) => &s.drawing.shape_attr,
ShapeObject::Ellipse(s) => &s.drawing.shape_attr,
ShapeObject::Arc(s) => &s.drawing.shape_attr,
ShapeObject::Polygon(s) => &s.drawing.shape_attr,
ShapeObject::Curve(s) => &s.drawing.shape_attr,
ShapeObject::Group(g) => &g.shape_attr,
ShapeObject::Picture(p) => &p.shape_attr,
ShapeObject::Chart(c) => &c.drawing.shape_attr,
ShapeObject::Ole(o) => &o.drawing.shape_attr,
}
}
pub fn flow_height_hu(&self) -> i32 {
let attr = self.shape_attr();
let current = if attr.current_height_was_zero {
0
} else {
attr.current_height as i32
};
(self.common().height as i32).max(current)
}
pub fn flow_width_hu(&self) -> i32 {
let attr = self.shape_attr();
let current = if attr.current_width_was_zero {
0
} else {
attr.current_width as i32
};
(self.common().width as i32).max(current)
}
pub fn shape_attr_mut(&mut self) -> &mut ShapeComponentAttr {
match self {
ShapeObject::Line(s) => &mut s.drawing.shape_attr,
ShapeObject::Rectangle(s) => &mut s.drawing.shape_attr,
ShapeObject::Ellipse(s) => &mut s.drawing.shape_attr,
ShapeObject::Arc(s) => &mut s.drawing.shape_attr,
ShapeObject::Polygon(s) => &mut s.drawing.shape_attr,
ShapeObject::Curve(s) => &mut s.drawing.shape_attr,
ShapeObject::Group(g) => &mut g.shape_attr,
ShapeObject::Picture(p) => &mut p.shape_attr,
ShapeObject::Chart(c) => &mut c.drawing.shape_attr,
ShapeObject::Ole(o) => &mut o.drawing.shape_attr,
}
}
pub fn shape_name(&self) -> &'static str {
match self {
ShapeObject::Line(_) => "직선",
ShapeObject::Rectangle(_) => "사각형",
ShapeObject::Ellipse(_) => "타원",
ShapeObject::Arc(_) => "호",
ShapeObject::Polygon(_) => "다각형",
ShapeObject::Curve(_) => "곡선",
ShapeObject::Group(_) => "묶음",
ShapeObject::Picture(_) => "그림(묶음내)",
ShapeObject::Chart(_) => "차트",
ShapeObject::Ole(_) => "OLE",
}
}
}
#[derive(Debug, Default, Clone, serde::Serialize)]
pub struct LineShape {
pub common: CommonObjAttr,
pub drawing: DrawingObjAttr,
pub start: Point,
pub end: Point,
pub started_right_or_bottom: bool,
pub connector: Option<ConnectorData>,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
#[repr(u32)]
pub enum LinkLineType {
#[default]
StraightNoArrow = 0,
StraightOneWay = 1,
StraightBoth = 2,
StrokeNoArrow = 3,
StrokeOneWay = 4,
StrokeBoth = 5,
ArcNoArrow = 6,
ArcOneWay = 7,
ArcBoth = 8,
}
impl LinkLineType {
pub fn from_u32(v: u32) -> Self {
match v {
0 => Self::StraightNoArrow,
1 => Self::StraightOneWay,
2 => Self::StraightBoth,
3 => Self::StrokeNoArrow,
4 => Self::StrokeOneWay,
5 => Self::StrokeBoth,
6 => Self::ArcNoArrow,
7 => Self::ArcOneWay,
8 => Self::ArcBoth,
_ => Self::StraightNoArrow,
}
}
pub fn is_stroke(&self) -> bool {
matches!(
self,
Self::StrokeNoArrow | Self::StrokeOneWay | Self::StrokeBoth
)
}
pub fn is_arc(&self) -> bool {
matches!(self, Self::ArcNoArrow | Self::ArcOneWay | Self::ArcBoth)
}
}
#[derive(Debug, Clone, Default, serde::Serialize)]
pub struct ConnectorControlPoint {
pub x: i32,
pub y: i32,
pub point_type: u16,
}
#[derive(Debug, Clone, Default, serde::Serialize)]
pub struct ConnectorData {
pub link_type: LinkLineType,
pub start_subject_id: u32,
pub start_subject_index: u32,
pub end_subject_id: u32,
pub end_subject_index: u32,
pub control_points: Vec<ConnectorControlPoint>,
pub raw_trailing: Vec<u8>,
}
#[derive(Debug, Default, Clone, serde::Serialize)]
pub struct RectangleShape {
pub common: CommonObjAttr,
pub drawing: DrawingObjAttr,
pub round_rate: u8,
pub x_coords: [i32; 4],
pub y_coords: [i32; 4],
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)]
pub enum RectangleControlKind {
Rectangle,
TextBox,
}
impl RectangleShape {
pub fn control_kind(&self) -> RectangleControlKind {
if self.drawing.text_box.is_some() {
RectangleControlKind::TextBox
} else {
RectangleControlKind::Rectangle
}
}
}
#[derive(Debug, Default, Clone, serde::Serialize)]
pub struct EllipseShape {
pub common: CommonObjAttr,
pub drawing: DrawingObjAttr,
pub attr: u32,
pub center: Point,
pub axis1: Point,
pub axis2: Point,
pub start1: Point,
pub end1: Point,
pub start2: Point,
pub end2: Point,
}
#[derive(Debug, Default, Clone, serde::Serialize)]
pub struct ArcShape {
pub common: CommonObjAttr,
pub drawing: DrawingObjAttr,
pub arc_type: u8,
pub center: Point,
pub axis1: Point,
pub axis2: Point,
}
#[derive(Debug, Clone)]
pub struct PolygonAffineEditReference {
pub width: u32,
pub height: u32,
pub rotation: i16,
pub horz_flip: bool,
pub vert_flip: bool,
pub matrix: [f64; 6],
}
#[derive(Debug, Default, Clone, serde::Serialize)]
pub struct PolygonShape {
pub common: CommonObjAttr,
pub drawing: DrawingObjAttr,
pub points: Vec<Point>,
#[serde(skip)]
pub affine_edit_reference: Option<PolygonAffineEditReference>,
pub raw_trailing: Vec<u8>,
}
#[derive(Debug, Default, Clone, serde::Serialize)]
pub struct CurveShape {
pub common: CommonObjAttr,
pub drawing: DrawingObjAttr,
pub points: Vec<Point>,
pub segment_types: Vec<u8>,
}
#[derive(Debug, Default, Clone, serde::Serialize)]
pub struct GroupShape {
pub common: CommonObjAttr,
pub shape_attr: ShapeComponentAttr,
pub children: Vec<ShapeObject>,
pub caption: Option<Caption>,
}
#[derive(Debug, Default, Clone, serde::Serialize)]
pub struct Caption {
pub direction: CaptionDirection,
pub vert_align: CaptionVertAlign,
pub width: HwpUnit,
pub spacing: HwpUnit16,
pub max_width: HwpUnit,
pub include_margin: bool,
pub paragraphs: Vec<Paragraph>,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
pub enum CaptionDirection {
Left,
Right,
Top,
#[default]
Bottom,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
pub enum CaptionVertAlign {
#[default]
Top,
Center,
Bottom,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
pub enum ChartType {
Bar,
Column,
Line,
Pie,
Area,
Scatter,
#[default]
Unknown,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
pub enum LegendPosition {
#[default]
Right,
Left,
Top,
Bottom,
TopLeft,
TopRight,
BottomLeft,
BottomRight,
Hidden,
}
#[derive(Debug, Clone, Default, serde::Serialize)]
pub struct Legend {
pub position: LegendPosition,
pub visible: bool,
}
#[derive(Debug, Clone, Default, serde::Serialize)]
pub struct Axis {
pub label: Option<String>,
pub labels: Vec<String>,
pub min: Option<f64>,
pub max: Option<f64>,
}
#[derive(Debug, Clone, Default, serde::Serialize)]
pub struct DataSeries {
pub name: String,
pub values: Vec<f64>,
pub categories: Vec<String>,
pub color: Option<u32>,
}
#[derive(Debug, Clone, Default, serde::Serialize)]
pub struct ChartShape {
pub common: CommonObjAttr,
pub drawing: DrawingObjAttr,
pub chart_type: ChartType,
pub title: Option<String>,
pub legend: Option<Legend>,
pub x_axis: Option<Axis>,
pub y_axis: Option<Axis>,
pub series: Vec<DataSeries>,
pub raw_chart_data: Vec<u8>,
pub caption: Option<Caption>,
}
#[derive(Debug, Clone, Copy, PartialEq, serde::Serialize)]
pub enum OlePreviewFormat {
Wmf,
Emf,
Png,
Bmp,
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct OlePreview {
pub format: OlePreviewFormat,
pub bytes: Vec<u8>,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, serde::Serialize)]
pub enum OleDrawingAspect {
#[default]
Content,
Icon,
Thumbnail,
DocPrint,
}
#[derive(Debug, Clone, Default, serde::Serialize)]
pub struct OleShape {
pub common: CommonObjAttr,
pub drawing: DrawingObjAttr,
pub extent_x: i32,
pub extent_y: i32,
pub flags: u8,
pub drawing_aspect: OleDrawingAspect,
pub bin_data_id: u32,
pub preview: Option<OlePreview>,
pub raw_tag_data: Vec<u8>,
#[serde(skip)]
pub raw_tag_seal: Option<[u8; 32]>,
pub caption: Option<Caption>,
pub chart_id_ref: Option<String>,
pub chart_switch_fallback: Option<Box<OleShape>>,
pub hwpx_ole_id: Option<u32>,
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_common_obj_attr_default() {
let attr = CommonObjAttr::default();
assert!(!attr.treat_as_char);
assert_eq!(attr.text_wrap, TextWrap::Square);
}
#[test]
fn test_shape_object_line() {
let line = ShapeObject::Line(LineShape::default());
assert!(matches!(line, ShapeObject::Line(_)));
}
#[test]
fn test_text_wrap_variants() {
assert_eq!(TextWrap::default(), TextWrap::Square);
}
}