Skip to main content

CT_Table

Struct CT_Table 

Source
pub struct CT_Table {
    pub properties: Option<CT_TableProperties>,
    pub grid: CT_TableGrid,
    pub rows: Vec<CT_TableRow>,
    /* private fields */
}
Expand description

One DrawingML a:tbl with typed grid, rows, cells, and banding properties.

Fields§

§properties: Option<CT_TableProperties>§grid: CT_TableGrid§rows: Vec<CT_TableRow>

Implementations§

Source§

impl CT_Table

Source

pub fn new(rows: usize, columns: usize, width: Emu, height: Emu) -> Result<Self>

Creates a rectangular table using truncating quotients and assigns each remainder to the final column or row.

Source

pub fn from_xml(xml: &[u8]) -> Result<Self>

Parses a complete a:tbl with any namespace prefix.

Source

pub fn from_xml_with_inherited_namespaces( xml: &[u8], inherited_namespaces: &[(String, String)], ) -> Result<Self>

Parses an extracted table and retains namespace bindings inherited from its original ancestors so the standalone writer remains namespace complete.

Source

pub fn to_xml(&self) -> Result<Vec<u8>>

Serialises a self-contained table with fixed a: prefixes.

Source

pub fn set_column_width(&mut self, index: usize, width: Emu) -> Result<()>

Changes one grid-column width and keeps the column’s preserved a:gridCol content with it, even when other columns share the old or the new width.

Source

pub fn insert_row(&mut self, index: usize) -> Result<()>

Inserts a row before the row at index, or appends one when index equals the row count.

The new row copies the height of the row above it, or of the first row when it becomes the first. Each new cell copies the cell properties of that row’s cell in the same column and the formatting of its first paragraph without the text. A row inserted inside a merged cell extends the merge, and every other new cell is unmerged.

Source

pub fn remove_row(&mut self, index: usize) -> Result<()>

Removes the row at index, which must not be the only row.

A merged cell across the row loses one row of its span. When the row holds the top of such a merge, the row below takes over the origin, with the origin’s text and cell properties.

Source

pub fn insert_column(&mut self, index: usize) -> Result<()>

Inserts a grid column before the column at index, or appends one when index equals the column count.

The new column copies the width of the column left of it, or of the first column when it becomes the first, and each new cell copies that column’s cell in the same row as insert_row does. A column inserted inside a merged cell extends the merge, and every other new cell is unmerged.

Source

pub fn remove_column(&mut self, index: usize) -> Result<()>

Removes the grid column at index, which must not be the only one.

A merged cell across the column loses one column of its span. When the column holds the left edge of such a merge, the column to its right takes over the origin, with the origin’s text and cell properties.

Source

pub fn validate_grid_and_merges(&self) -> Result<()>

Returns every merged rectangle by its origin, after checking that each row has one explicit cell per grid column and that every merge fits the grid. Checks the explicit grid and every modeled merge continuation.

Trait Implementations§

Source§

impl Clone for CT_Table

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CT_Table

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CT_Table

Source§

impl PartialEq for CT_Table

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.