LibreOffice Module sc (master)  1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ScExternalRefCache::Table Class Reference

Represents a single cached table in an external document. More...

#include <externalrefmgr.hxx>

Collaboration diagram for ScExternalRefCache::Table:
[legend]

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=0, SCROW nHigh=MAXROW) const
 Obtain a sorted vector of rows. More...
 
SC_DLLPUBLIC::std::pair< SCROW, SCROWgetRowRange () 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=0, SCCOL nHigh=MAXCOL) const
 Obtain a sorted vector of columns. More...
 
SC_DLLPUBLIC::std::pair< SCCOL, SCCOLgetColRange (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...
 

Private Member Functions

bool isInCachedRanges (SCCOL nCol, SCROW nRow) const
 
TokenRef getEmptyOrNullToken (SCCOL nCol, SCROW nRow) const
 

Private Attributes

RowsDataType maRows
 Data cache. More...
 
ScRangeList maCachedRanges
 Collection of individual cached ranges. More...
 
bool mbReferenced
 

Detailed Description

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 123 of file externalrefmgr.hxx.

Constructor & Destructor Documentation

ScExternalRefCache::Table::Table ( )

Definition at line 249 of file externalrefmgr.cxx.

ScExternalRefCache::Table::~Table ( )

Definition at line 255 of file externalrefmgr.cxx.

Member Function Documentation

void ScExternalRefCache::Table::clear ( )

Definition at line 259 of file externalrefmgr.cxx.

void ScExternalRefCache::Table::getAllCols ( SCROW  nRow,
::std::vector< SCCOL > &  rCols,
SCCOL  nLow = 0,
SCCOL  nHigh = MAXCOL 
) const

Obtain a sorted vector of columns.

Definition at line 360 of file externalrefmgr.cxx.

void ScExternalRefCache::Table::getAllNumberFormats ( ::std::vector< sal_uInt32 > &  rNumFmts) const

Definition at line 400 of file externalrefmgr.cxx.

References ScExternalRefCache::Cell::mnFmtIndex.

void ScExternalRefCache::Table::getAllRows ( ::std::vector< SCROW > &  rRows,
SCROW  nLow = 0,
SCROW  nHigh = MAXROW 
) const

Obtain a sorted vector of rows.

Definition at line 333 of file externalrefmgr.cxx.

ScExternalRefCache::TokenRef ScExternalRefCache::Table::getCell ( SCCOL  nCol,
SCROW  nRow,
sal_uInt32 *  pnFmtIndex = nullptr 
) const
std::pair< SCCOL, SCCOL > ScExternalRefCache::Table::getColRange ( SCROW  nRow) const

Returns the half-open range of used columns in the specified row. Returns [0,0) if row is empty.

Definition at line 379 of file externalrefmgr.cxx.

References a.

ScExternalRefCache::TokenRef ScExternalRefCache::Table::getEmptyOrNullToken ( SCCOL  nCol,
SCROW  nRow 
) const
private

Definition at line 439 of file externalrefmgr.cxx.

References p.

std::pair< SCROW, SCROW > ScExternalRefCache::Table::getRowRange ( ) const

Returns the half-open range of used rows in this table. Returns [0,0) if table is empty.

Definition at line 346 of file externalrefmgr.cxx.

References a.

bool ScExternalRefCache::Table::hasRow ( SCROW  nRow) const

Definition at line 327 of file externalrefmgr.cxx.

bool ScExternalRefCache::Table::isInCachedRanges ( SCCOL  nCol,
SCROW  nRow 
) const
private

Definition at line 434 of file externalrefmgr.cxx.

bool ScExternalRefCache::Table::isRangeCached ( SCCOL  nCol1,
SCROW  nRow1,
SCCOL  nCol2,
SCROW  nRow2 
) const

Definition at line 413 of file externalrefmgr.cxx.

bool ScExternalRefCache::Table::isReferenced ( ) const

Definition at line 271 of file externalrefmgr.cxx.

void ScExternalRefCache::Table::setCachedCell ( SCCOL  nCol,
SCROW  nRow 
)

Definition at line 418 of file externalrefmgr.cxx.

void ScExternalRefCache::Table::setCachedCellRange ( SCCOL  nCol1,
SCROW  nRow1,
SCCOL  nCol2,
SCROW  nRow2 
)

Definition at line 423 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.

Parameters
bSetCacheRangeif true, mark this cell 'cached'. This is false only when adding a range of cell values, for performance reasons.

Definition at line 276 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 266 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 429 of file externalrefmgr.cxx.

References MAXCOL, and MAXROW.

Member Data Documentation

ScRangeList ScExternalRefCache::Table::maCachedRanges
private

Collection of individual cached ranges.

The table ranges are not used & always zero.

Definition at line 177 of file externalrefmgr.hxx.

RowsDataType ScExternalRefCache::Table::maRows
private

Data cache.

Definition at line 174 of file externalrefmgr.hxx.

bool ScExternalRefCache::Table::mbReferenced
private

Definition at line 178 of file externalrefmgr.hxx.


The documentation for this class was generated from the following files: