pub struct Cell<'a> {
pub element: &'a Element,
pub covered: bool,
}Expand description
One cell, as found in the tree.
Fields§
§element: &'a ElementThe table:table-cell element, so that anything not modelled here is
still reachable.
covered: boolTrue when this is a table:covered-table-cell: a cell hidden underneath
a neighbour’s span. It is kept rather than skipped because the grid has to
know not to draw a border there.
Implementations§
Source§impl Cell<'_>
impl Cell<'_>
Sourcepub fn text(&self) -> String
pub fn text(&self) -> String
What the cell shows: the text the producing application formatted and stored in the cell’s paragraphs.
This is why a viewer needs neither a number-format engine nor a formula evaluator. ODF requires a cell to carry both its typed value and the text of that value as the document was last displayed, so the formatted string — thousands separators, currency symbol, date order, decimal places — is already in the file. A cell edited here would have to be re-formatted from its data style, which is the work an editor adds and a viewer does not.
A cell with more than one paragraph gives them separated by newlines.
Sourcepub fn formula(&self) -> Option<&str>
pub fn formula(&self) -> Option<&str>
The formula, without the namespace prefix ODF writes in front of it.
A formula is written of:=SUM([.A1:.A9]), where the part before the
colon says which formula language it is in. The prefix is dropped here
and the expression given as it stands: nothing in this release evaluates
one, and a formula bar shows what the document says.
Sourcepub fn style_name(&self) -> Option<&str>
pub fn style_name(&self) -> Option<&str>
The cell style the cell names, if it names one.
Sourcepub fn columns_spanned(&self) -> usize
pub fn columns_spanned(&self) -> usize
How many columns the cell spans, which is one unless it says otherwise.
Sourcepub fn rows_spanned(&self) -> usize
pub fn rows_spanned(&self) -> usize
How many rows the cell spans.