pub struct SheetDocument {
pub document: Document,
/* private fields */
}Expand description
An OpenDocument spreadsheet.
Fields§
§document: DocumentThe package and everything shared with the other two formats.
Implementations§
Source§impl SheetDocument
impl SheetDocument
Sourcepub fn restructure(
&mut self,
sheet: usize,
change: Restructure,
) -> Result<(), Blocked>
pub fn restructure( &mut self, sheet: usize, change: Restructure, ) -> Result<(), Blocked>
Source§impl SheetDocument
impl SheetDocument
Sourcepub fn reindex(&mut self)
pub fn reindex(&mut self)
Rebuild the index after the content tree has been replaced under it, which is what undo does.
Sourcepub fn can_edit(
&self,
sheet: usize,
row: usize,
column: usize,
) -> Result<(), Refused>
pub fn can_edit( &self, sheet: usize, row: usize, column: usize, ) -> Result<(), Refused>
Whether a cell may be written, which is what Self::set_cell asks
first and what a window asks before it opens an editor.
§Errors
The cell is under a neighbour’s span, holds a formula, or the sheet does not exist.
Sourcepub fn set_cell(
&mut self,
sheet: usize,
row: usize,
column: usize,
value: &Value,
) -> Result<(), Refused>
pub fn set_cell( &mut self, sheet: usize, row: usize, column: usize, value: &Value, ) -> Result<(), Refused>
Put a value in a cell, by sheet, row and column, all counting from zero.
A row or a cell the document wrote once with a repeat count is split into the run before, the one, and the run after, with the counts fixed, so that the one cell changes and its neighbours in the run keep what they had. A row or cell past what the document wrote is created, with a repeated empty run filling the gap. The cell’s own attributes and paragraphs are replaced; its style, and anything else in it, stay.
§Errors
The cell is under a neighbour’s span, holds a formula, or the sheet does not exist. Nothing is changed in any of those cases.
Sourcepub fn cell(&self, sheet: &Sheet, row: usize, column: usize) -> Option<Cell<'_>>
pub fn cell(&self, sheet: &Sheet, row: usize, column: usize) -> Option<Cell<'_>>
One cell, by sheet, row and column, all counting from zero.
None for a cell the document never wrote, which is the usual answer
past the edge of the used range and means an empty cell rather than an
error.
Sourcepub fn row_element(&self, sheet: &Sheet, row: usize) -> Option<&Element>
pub fn row_element(&self, sheet: &Sheet, row: usize) -> Option<&Element>
The table:table-row element a row number falls in.
Sourcepub fn row_height(&self, sheet: &Sheet, row: usize) -> Option<Length>
pub fn row_height(&self, sheet: &Sheet, row: usize) -> Option<Length>
A row’s height, where its style gives one.
Sourcepub fn cell_style(
&self,
sheet: &Sheet,
cell: Option<&Cell<'_>>,
column: usize,
) -> Rc<Properties>
pub fn cell_style( &self, sheet: &Sheet, cell: Option<&Cell<'_>>, column: usize, ) -> Rc<Properties>
The resolved style of a cell: the style it names, or the one its column gives every cell that names none.