LibreOffice Module sc (master) 1
|
Represents a single cached table in an external document. More...
#include <externalrefmgr.hxx>
Public Member Functions | |
Table () | |
~Table () | |
void | clear () |
SC_DLLPUBLIC void | setCell (SCCOL nCol, SCROW nRow, TokenRef const &pToken, sal_uLong nFmtIndex=0, bool bSetCacheRange=true) |
Add cell value to the cache. More... | |
SC_DLLPUBLIC TokenRef | getCell (SCCOL nCol, SCROW nRow, sal_uInt32 *pnFmtIndex=nullptr) const |
bool | hasRow (SCROW nRow) const |
void | setReferenced (bool bReferenced) |
Set/clear referenced status flag only if current status is not REFERENCED_PERMANENT. More... | |
bool | isReferenced () const |
void | getAllRows (::std::vector< SCROW > &rRows, SCROW nLow, SCROW nHigh) const |
Obtain a sorted vector of rows. More... | |
void | getAllRows (::std::vector< SCROW > &rRows) const |
SC_DLLPUBLIC ::std::pair< SCROW, SCROW > | getRowRange () const |
Returns the half-open range of used rows in this table. Returns [0,0) if table is empty. More... | |
void | getAllCols (SCROW nRow, ::std::vector< SCCOL > &rCols, SCCOL nLow, SCCOL nHigh) const |
Obtain a sorted vector of columns. More... | |
void | getAllCols (SCROW nRow, ::std::vector< SCCOL > &rCols) const |
SC_DLLPUBLIC ::std::pair< SCCOL, SCCOL > | getColRange (SCROW nRow) const |
Returns the half-open range of used columns in the specified row. Returns [0,0) if row is empty. More... | |
void | getAllNumberFormats (::std::vector< sal_uInt32 > &rNumFmts) const |
bool | isRangeCached (SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const |
void | setCachedCell (SCCOL nCol, SCROW nRow) |
void | setCachedCellRange (SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) |
SC_DLLPUBLIC void | setWholeTableCached () |
Call this to mark the entire table "cached". More... | |
template<typename P > | |
void | getAllRows (vector< SCROW > &rRows, P predicate) const |
template<typename P > | |
void | getAllCols (SCROW nRow, vector< SCCOL > &rCols, P predicate) const |
Private Member Functions | |
bool | isInCachedRanges (SCCOL nCol, SCROW nRow) const |
TokenRef | getEmptyOrNullToken (SCCOL nCol, SCROW nRow) const |
template<typename P > | |
void | getAllRows (::std::vector< SCROW > &rRows, P predicate) const |
template<typename P > | |
void | getAllCols (SCROW nRow, ::std::vector< SCCOL > &rCols, P predicate) const |
Private Attributes | |
RowsDataType | maRows |
Data cache. More... | |
ScRangeList | maCachedRanges |
Collection of individual cached ranges. More... | |
bool | mbReferenced |
Represents a single cached table in an external document.
It only stores non-empty cells; empty cells should never be stored in the data cache. Instead, cached ranges should be used to determine whether or not a cell is empty or needs fetching from the source document. If a cell's value is not stored but its address is within the cached ranges, that cell is already queried in the source document and we know it's empty.
Definition at line 124 of file externalrefmgr.hxx.
ScExternalRefCache::Table::Table | ( | ) |
Definition at line 250 of file externalrefmgr.cxx.
ScExternalRefCache::Table::~Table | ( | ) |
Definition at line 256 of file externalrefmgr.cxx.
void ScExternalRefCache::Table::clear | ( | ) |
Definition at line 260 of file externalrefmgr.cxx.
|
private |
void ScExternalRefCache::Table::getAllCols | ( | SCROW | nRow, |
::std::vector< SCCOL > & | rCols, | ||
SCCOL | nLow, | ||
SCCOL | nHigh | ||
) | const |
Obtain a sorted vector of columns.
void ScExternalRefCache::Table::getAllCols | ( | SCROW | nRow, |
vector< SCCOL > & | rCols, | ||
P | predicate | ||
) | const |
Definition at line 374 of file externalrefmgr.cxx.
void ScExternalRefCache::Table::getAllNumberFormats | ( | ::std::vector< sal_uInt32 > & | rNumFmts | ) | const |
Definition at line 425 of file externalrefmgr.cxx.
References ScExternalRefCache::Cell::mnFmtIndex.
void ScExternalRefCache::Table::getAllRows | ( | ::std::vector< SCROW > & | rRows | ) | const |
|
private |
void ScExternalRefCache::Table::getAllRows | ( | ::std::vector< SCROW > & | rRows, |
SCROW | nLow, | ||
SCROW | nHigh | ||
) | const |
Obtain a sorted vector of rows.
void ScExternalRefCache::Table::getAllRows | ( | vector< SCROW > & | rRows, |
P | predicate | ||
) | const |
Definition at line 335 of file externalrefmgr.cxx.
ScExternalRefCache::TokenRef ScExternalRefCache::Table::getCell | ( | SCCOL | nCol, |
SCROW | nRow, | ||
sal_uInt32 * | pnFmtIndex = nullptr |
||
) | const |
Definition at line 304 of file externalrefmgr.cxx.
References ScExternalRefCache::Cell::mnFmtIndex, and ScExternalRefCache::Cell::mxToken.
Returns the half-open range of used columns in the specified row. Returns [0,0) if row is empty.
Definition at line 404 of file externalrefmgr.cxx.
References a.
|
private |
Definition at line 464 of file externalrefmgr.cxx.
References p.
Returns the half-open range of used rows in this table. Returns [0,0) if table is empty.
Definition at line 359 of file externalrefmgr.cxx.
References a.
bool ScExternalRefCache::Table::hasRow | ( | SCROW | nRow | ) | const |
Definition at line 328 of file externalrefmgr.cxx.
Definition at line 459 of file externalrefmgr.cxx.
bool ScExternalRefCache::Table::isRangeCached | ( | SCCOL | nCol1, |
SCROW | nRow1, | ||
SCCOL | nCol2, | ||
SCROW | nRow2 | ||
) | const |
Definition at line 438 of file externalrefmgr.cxx.
bool ScExternalRefCache::Table::isReferenced | ( | ) | const |
Definition at line 272 of file externalrefmgr.cxx.
Definition at line 443 of file externalrefmgr.cxx.
void ScExternalRefCache::Table::setCachedCellRange | ( | SCCOL | nCol1, |
SCROW | nRow1, | ||
SCCOL | nCol2, | ||
SCROW | nRow2 | ||
) |
Definition at line 448 of file externalrefmgr.cxx.
void ScExternalRefCache::Table::setCell | ( | SCCOL | nCol, |
SCROW | nRow, | ||
TokenRef const & | pToken, | ||
sal_uLong | nFmtIndex = 0 , |
||
bool | bSetCacheRange = true |
||
) |
Add cell value to the cache.
bSetCacheRange | if true, mark this cell 'cached'. This is false only when adding a range of cell values, for performance reasons. |
Definition at line 277 of file externalrefmgr.cxx.
References ScExternalRefCache::Cell::mnFmtIndex, and ScExternalRefCache::Cell::mxToken.
void ScExternalRefCache::Table::setReferenced | ( | bool | bReferenced | ) |
Set/clear referenced status flag only if current status is not REFERENCED_PERMANENT.
Definition at line 267 of file externalrefmgr.cxx.
void ScExternalRefCache::Table::setWholeTableCached | ( | ) |
Call this to mark the entire table "cached".
This will prevent all future attempts to access the source document even when non-cached cells are queried. In such case, non-cached cells are treated as empty cells. Useful when loading a document with own external data cache.
Definition at line 454 of file externalrefmgr.cxx.
|
private |
Collection of individual cached ranges.
The table ranges are not used & always zero.
Definition at line 184 of file externalrefmgr.hxx.
|
private |
Data cache.
Definition at line 181 of file externalrefmgr.hxx.
|
private |
Definition at line 185 of file externalrefmgr.hxx.