The XLRow class represent a row in an Excel spreadsheet. Using XLRow objects, various row formatting options can be set and modified.
More...
#include <XLRow.hpp>
The XLRow class represent a row in an Excel spreadsheet. Using XLRow objects, various row formatting options can be set and modified.
◆ XLRow() [1/4]
| OpenXLSX::XLRow::XLRow |
( |
| ) |
|
◆ XLRow() [2/4]
- Parameters
-
Constructs a new XLRow object from information in the underlying XML file. A pointer to the corresponding node in the underlying XML file must be provided.
◆ XLRow() [3/4]
| OpenXLSX::XLRow::XLRow |
( |
const XLRow & |
other | ) |
|
Copy Constructor.
- Note
- The copy constructor is explicitly deleted
◆ XLRow() [4/4]
| OpenXLSX::XLRow::XLRow |
( |
XLRow && |
other | ) |
|
|
noexcept |
Move Constructor.
- Note
- The move constructor has been explicitly deleted.
Because the m_rowDataProxy variable is tied to an exact XLRow object, the move operation is not a 'pure' move, as a new XLRowDataProxy has to be constructed.
◆ ~XLRow()
| OpenXLSX::XLRow::~XLRow |
( |
| ) |
|
|
default |
Destructor.
- Note
- The destructor has a default implementation.
◆ cellCount()
| uint16_t OpenXLSX::XLRow::cellCount |
( |
| ) |
const |
Get the number of cells in the row.
- Returns
- The number of cells in the row.
Get the number of cells in the row, by returning the size of the m_cells vector.
◆ cells() [1/3]
◆ cells() [2/3]
◆ cells() [3/3]
| XLRowDataRange OpenXLSX::XLRow::cells |
( |
uint16_t |
firstCell, |
|
|
uint16_t |
lastCell |
|
) |
| const |
◆ descent()
| float OpenXLSX::XLRow::descent |
( |
| ) |
const |
Get the descent of the row, which is the vertical distance in pixels from the bottom of the cells in the current row to the typographical baseline of the cell content.
- Returns
- The row descent.
Retrieves the row's vertical descent value. This is used by Excel's rendering engine to appropriately position text baselines for certain fonts.
◆ empty()
| bool OpenXLSX::XLRow::empty |
( |
| ) |
const |
test if row object has no (valid) content
- Returns
◆ findCell()
| XLCell OpenXLSX::XLRow::findCell |
( |
uint16_t |
columnNumber | ) |
|
Find a cell at columNumber, or return an empty cell.
- Parameters
-
| columNumber | The column at which to check for an existing cell |
- Returns
- An XLCell object (that bool-evaluates to false if cell was not found)
Find & return a cell in indicated column
◆ format()
Get the array index of xl/styles.xml:<styleSheet>:<cellXfs> for the style assigned to the row. This value is stored in the row attributes like so: s="2".
- Returns
- The index of the applicable format style
Determine the value of the style attribute "s" - if attribute does not exist, return default value
◆ height()
| double OpenXLSX::XLRow::height |
( |
| ) |
const |
Get the height of the row.
- Returns
- the row height.
Retrieves the explicitly assigned height of the row. If no custom height is set, it defaults to 15.0.
◆ isCollapsed()
| bool OpenXLSX::XLRow::isCollapsed |
( |
| ) |
const |
Is the row collapsed?
- Returns
- true if the row is collapsed.
Checks if the row carries the collapsed marker. In Excel, this flag is typically placed on the summary row adjacent to a hidden group to render the '+' expansion UI button.
◆ isHidden()
| bool OpenXLSX::XLRow::isHidden |
( |
| ) |
const |
Is the row hidden?
- Returns
- The state of the row.
Retrieves the row's visibility state. Hidden rows remain in the document and participate in calculations, but are not rendered in the spreadsheet UI.
◆ operator bool()
| OpenXLSX::XLRow::operator bool |
( |
| ) |
const |
|
explicit |
◆ operator=() [1/2]
| XLRow & OpenXLSX::XLRow::operator= |
( |
const XLRow & |
other | ) |
|
Copy assignment operator.
- Note
- The copy assignment operator is explicitly deleted.
◆ operator=() [2/2]
| XLRow & OpenXLSX::XLRow::operator= |
( |
XLRow && |
other | ) |
|
|
noexcept |
Move assignment operator.
- Note
- The move assignment operator has been explicitly deleted.
Because the m_rowDataProxy variable is tied to an exact XLRow object, the move operation is not a 'pure' move, as a new XLRowDataProxy has to be constructed.
◆ outlineLevel()
| uint8_t OpenXLSX::XLRow::outlineLevel |
( |
| ) |
const |
Get the outline level of the row.
- Returns
- The outline level (0-7).
Retrieves the row's outline level (0-7), which determines its nesting depth within a hierarchical grouping structure.
◆ rowNumber()
| uint32_t OpenXLSX::XLRow::rowNumber |
( |
| ) |
const |
- Returns
- Note
- 2024-08-18: changed return type of rowNumber to uint32_t CAUTION: there is no validity check on the underlying XML (nor was there ever one in case a value was inconsistent with OpenXLSX::MAX_ROWS)
◆ setCollapsed()
| void OpenXLSX::XLRow::setCollapsed |
( |
bool |
state | ) |
|
Set the row to be collapsed or expanded.
- Parameters
-
| state | The collapsed state of the row. |
Controls the expansion UI marker ('+' or '-') for grouped rows. This must be set on the summary row that remains visible when the corresponding detailed rows are hidden.
◆ setDescent()
| void OpenXLSX::XLRow::setDescent |
( |
float |
descent | ) |
|
Set the descent of the row, which is he vertical distance in pixels from the bottom of the cells in the current row to the typographical baseline of the cell content.
- Parameters
-
Sets the typography descent attribute. This fine-tunes how far characters drop below the text baseline in this specific row, maintaining exact layout fidelity.
◆ setFormat()
| bool OpenXLSX::XLRow::setFormat |
( |
XLStyleIndex |
cellFormatIndex | ) |
|
Set the row style as a reference to the array index of xl/styles.xml:<styleSheet>:<cellXfs>
Set the row style as a reference to the array index of xl/styles.xml:<styleSheet>:<cellXfs> If the style attribute "s" does not exist, create it.
- Parameters
-
- Returns
- true on success, false on failure
◆ setHeight()
| void OpenXLSX::XLRow::setHeight |
( |
float |
height | ) |
|
Set the height of the row.
- Parameters
-
| height | The height of the row. |
Modifies the visual height of the row. The 'customHeight' attribute must be explicitly set to 1, otherwise MS Excel will ignore the 'ht' value and auto-fit the row height based on cell contents.
◆ setHidden()
| void OpenXLSX::XLRow::setHidden |
( |
bool |
state | ) |
|
Set the row to be hidden or visible.
- Parameters
-
| state | The state of the row. |
Modifies the visual state of the row. Typically used for applying filters or manually hiding rows without deleting their underlying data or breaking formulas.
◆ setOutlineLevel()
| void OpenXLSX::XLRow::setOutlineLevel |
( |
uint8_t |
level | ) |
|
Set the outline level of the row.
- Parameters
-
| level | The outline level (0-7). |
Applies a grouping depth to the row. Values > 7 are capped, as MS Excel only supports up to 8 levels (0-7). Setting the level to 0 completely removes the outline grouping attribute.
◆ values() [1/3]
◆ values() [2/3]
◆ values() [3/3]
template<typename T >
| T OpenXLSX::XLRow::values |
( |
| ) |
const |
|
inline |
- Template Parameters
-
- Returns
◆ operator!=
| bool operator!= |
( |
const XLRow & |
lhs, |
|
|
const XLRow & |
rhs |
|
) |
| |
|
friend |
◆ operator<
| bool operator< |
( |
const XLRow & |
lhs, |
|
|
const XLRow & |
rhs |
|
) |
| |
|
friend |
◆ operator<=
| bool operator<= |
( |
const XLRow & |
lhs, |
|
|
const XLRow & |
rhs |
|
) |
| |
|
friend |
◆ operator==
| bool operator== |
( |
const XLRow & |
lhs, |
|
|
const XLRow & |
rhs |
|
) |
| |
|
friend |
◆ operator>
| bool operator> |
( |
const XLRow & |
lhs, |
|
|
const XLRow & |
rhs |
|
) |
| |
|
friend |
◆ operator>=
| bool operator>= |
( |
const XLRow & |
lhs, |
|
|
const XLRow & |
rhs |
|
) |
| |
|
friend |
◆ XLRowDataProxy
◆ XLRowIterator
The documentation for this class was generated from the following files:
- /home/runner/work/OpenXLSX-NX/OpenXLSX-NX/OpenXLSX/headers/XLRow.hpp
- /home/runner/work/OpenXLSX-NX/OpenXLSX-NX/OpenXLSX/sources/XLRow.cpp