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

Constructor & Destructor Documentation

ScExternalRefCache::Table::Table ( )

Definition at line 248 of file externalrefmgr.cxx.

ScExternalRefCache::Table::~Table ( )

Definition at line 254 of file externalrefmgr.cxx.

Member Function Documentation

void ScExternalRefCache::Table::clear ( )

Definition at line 258 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 359 of file externalrefmgr.cxx.

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

Definition at line 399 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 332 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 378 of file externalrefmgr.cxx.

References a.

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

Definition at line 438 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 345 of file externalrefmgr.cxx.

References a.

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

Definition at line 326 of file externalrefmgr.cxx.

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

Definition at line 433 of file externalrefmgr.cxx.

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

Definition at line 412 of file externalrefmgr.cxx.

bool ScExternalRefCache::Table::isReferenced ( ) const

Definition at line 270 of file externalrefmgr.cxx.

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

Definition at line 417 of file externalrefmgr.cxx.

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

Definition at line 422 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 275 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 265 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 428 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 178 of file externalrefmgr.hxx.

RowsDataType ScExternalRefCache::Table::maRows
private

Data cache.

Definition at line 175 of file externalrefmgr.hxx.

bool ScExternalRefCache::Table::mbReferenced
private

Definition at line 179 of file externalrefmgr.hxx.


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