docx_reader/documents/elements/
level_override.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use super::*;

use serde::Serialize;

/*
17.9.8 lvlOverride (Numbering Level Definition Override)
This element specifies an optional override which shall be applied in place of zero or more levels from the abstract numbering definition for a given numbering definition instance. Each instance of this element is used to override the appearance and behavior of a given numbering level definition within the given abstract numbering definition.
*/
#[derive(Debug, Clone, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct LevelOverride {
	pub level: usize,
	pub override_start: Option<usize>,
	pub override_level: Option<Level>,
}

impl LevelOverride {
	pub fn new(level: usize) -> LevelOverride {
		LevelOverride {
			level,
			override_start: None,
			override_level: None,
		}
	}

	pub fn start(mut self, start: usize) -> LevelOverride {
		self.override_start = Some(start);
		self
	}

	pub fn level(mut self, override_level: Level) -> LevelOverride {
		self.override_level = Some(override_level);
		self
	}
}