ooodev.adapter.sheet.cell_range_access_partial module

class ooodev.adapter.sheet.cell_range_access_partial.CellRangeAccessPartial(component, interface=com.sun.star.sheet.XCellRangesAccess)[source]

Bases: object

Partial class for XCellRangesAccess.

Parameters:
  • component (XCellRangesAccess) –

  • interface (UnoInterface | None) –

__init__(component, interface=com.sun.star.sheet.XCellRangesAccess)[source]

Constructor

Parameters:
  • component (XCellRangesAccess) – UNO Component that implements com.sun.star.container.XCellRangesAccess interface.

  • interface (UnoInterface, optional) – The interface to be validated. Defaults to XCellRangesAccess.

Return type:

None

get_cell_by_position(col, row, idx)[source]

Returns the cell at the specified position.

Parameters:
  • col (int) – The column index of the cell inside the sheet.

  • row (int) – The row index of the cell inside the sheet.

  • idx (int) – the sheet index of the sheet inside the document.

Returns:

The single cell within the range.

Return type:

XCell

get_cell_range_by_position(start_col, start_row, end_col, end_row, idx)[source]

Returns the cell range at the specified position.

Parameters:
  • start_col (int) – The column index of the first cell inside the sheet.

  • start_row (int) – The row index of the first cell inside the sheet.

  • end_col (int) – The column index of the last cell inside the sheet.

  • end_row (int) – The row index of the last cell inside the sheet.

  • idx (int) – The sheet index of the sheet inside the document.

Returns:

The cell range.

Return type:

XCellRange

get_cell_ranges_by_name(name)[source]

Returns a sub-range of cells within the range.

The sub-range is specified by its name. The format of the range name is dependent of the context of the table. In spreadsheets valid names may be Sheet1.A1:C5 or $Sheet1.$B$2 or even defined names for cell ranges such as MySpecialCell.

Parameters:

name (str) – The name of the range.

Returns:

The cell ranges.

Return type:

tuple[XCellRange, …]