LibreOffice Module sc (master) 1
|
This class is only a wrapper to the actual cache, to provide filtering on the raw data based on the query filter and/or page field filters. More...
#include <dpfilteredcache.hxx>
Classes | |
struct | Criterion |
single filtering criterion. More... | |
class | FilterBase |
interface class used for filtering of rows. More... | |
class | GroupFilter |
multi-item (group) filter. More... | |
class | SingleFilter |
ordinary single-item filter. More... | |
Public Member Functions | |
ScDPFilteredCache (const ScDPCache &rCache) | |
~ScDPFilteredCache () | |
sal_Int32 | getRowSize () const |
sal_Int32 | getColSize () const |
const ScDPCache & | getCache () const |
void | fillTable (const ScQueryParam &rQuery, bool bIgnoreEmptyRows, bool bRepeatIfEmpty) |
void | fillTable () |
bool | isRowActive (sal_Int32 nRow, sal_Int32 *pLastRow=nullptr) const |
Check whether a specified row is active or not. More... | |
void | filterByPageDimension (const std::vector< Criterion > &rCriteria, const std::unordered_set< sal_Int32 > &rRepeatIfEmptyDims) |
Set filter on/off flag to each row to control visibility. More... | |
const ScDPItemData * | getCell (SCCOL nCol, SCROW nRow, bool bRepeatIfEmpty) const |
Get the cell instance at specified location within the data grid. More... | |
void | getValue (ScDPValue &rVal, SCCOL nCol, SCROW nRow) const |
OUString | getFieldName (SCCOL nIndex) const |
const ::std::vector< SCROW > & | getFieldEntries (sal_Int32 nColumn) const |
Get the unique entries for a field specified by index. More... | |
void | filterTable (const std::vector< Criterion > &rCriteria, css::uno::Sequence< css::uno::Sequence< css::uno::Any > > &rTabData, const std::unordered_set< sal_Int32 > &rRepeatIfEmptyDims) |
Filter the table based on the specified criteria, and copy the result to rTabData. More... | |
void | clear () |
bool | empty () const |
void | dump () const |
Static Public Member Functions | |
static void | dumpRowFlag (const RowFlagType &rFlag) |
Private Types | |
typedef mdds::flat_segment_tree< SCROW, bool > | RowFlagType |
Private Member Functions | |
ScDPFilteredCache (const ScDPFilteredCache &)=delete | |
bool | isRowQualified (sal_Int32 nRow, const ::std::vector< Criterion > &rCriteria, const std::unordered_set< sal_Int32 > &rRepeatIfEmptyDims) const |
Check if a given row meets all specified criteria. More... | |
Private Attributes | |
::std::vector<::std::vector< SCROW > > | maFieldEntries |
unique field entries for each field (column). More... | |
RowFlagType | maShowByFilter |
Rows visible by standard filter query. More... | |
RowFlagType | maShowByPage |
Rows visible by page dimension filtering. More... | |
const ScDPCache & | mrCache |
This class is only a wrapper to the actual cache, to provide filtering on the raw data based on the query filter and/or page field filters.
Definition at line 49 of file dpfilteredcache.hxx.
|
private |
Definition at line 51 of file dpfilteredcache.hxx.
ScDPFilteredCache::ScDPFilteredCache | ( | const ScDPCache & | rCache | ) |
Definition at line 76 of file dpfilteredcache.cxx.
ScDPFilteredCache::~ScDPFilteredCache | ( | ) |
Definition at line 81 of file dpfilteredcache.cxx.
|
privatedelete |
void ScDPFilteredCache::clear | ( | ) |
Definition at line 358 of file dpfilteredcache.cxx.
References maFieldEntries, maShowByFilter, and maShowByPage.
Referenced by ScDatabaseDPData::DisposeData(), ScSheetDPData::DisposeData(), ScDatabaseDPData::ReloadCacheTable(), and ScSheetDPData::ReloadCacheTable().
void ScDPFilteredCache::dump | ( | ) | const |
|
static |
bool ScDPFilteredCache::empty | ( | ) | const |
Definition at line 365 of file dpfilteredcache.cxx.
References maFieldEntries.
Referenced by ScDatabaseDPData::CreateCacheTable(), and ScSheetDPData::CreateCacheTable().
void ScDPFilteredCache::fillTable | ( | ) |
Definition at line 175 of file dpfilteredcache.cxx.
References getCache(), getColSize(), ScDPCache::GetDimMemberCount(), ScDPCache::GetItemDataId(), getRowSize(), maFieldEntries, maShowByFilter, maShowByPage, and nIndex.
void ScDPFilteredCache::fillTable | ( | const ScQueryParam & | rQuery, |
bool | bIgnoreEmptyRows, | ||
bool | bRepeatIfEmpty | ||
) |
Definition at line 95 of file dpfilteredcache.cxx.
References getCache(), getColSize(), ScDPCache::GetDataSize(), ScDPCache::GetDimMemberCount(), ScDPCache::GetItemDataId(), getRowSize(), maFieldEntries, maShowByFilter, maShowByPage, mrCache, and nIndex.
Referenced by ScDatabaseDPData::CreateCacheTable(), and ScSheetDPData::CreateCacheTable().
void ScDPFilteredCache::filterByPageDimension | ( | const std::vector< Criterion > & | rCriteria, |
const std::unordered_set< sal_Int32 > & | rRepeatIfEmptyDims | ||
) |
Set filter on/off flag to each row to control visibility.
The caller must ensure that the table is filled before calling this function.
Definition at line 232 of file dpfilteredcache.cxx.
References ScDPCache::GetDataSize(), getRowSize(), isRowQualified(), maShowByPage, and mrCache.
Referenced by ScSheetDPData::FilterCacheTable(), and ScDatabaseDPData::FilterCacheTable().
void ScDPFilteredCache::filterTable | ( | const std::vector< Criterion > & | rCriteria, |
css::uno::Sequence< css::uno::Sequence< css::uno::Any > > & | rTabData, | ||
const std::unordered_set< sal_Int32 > & | rRepeatIfEmptyDims | ||
) |
Filter the table based on the specified criteria, and copy the result to rTabData.
This method is used, for example, to generate a drill-down data table.
Definition at line 290 of file dpfilteredcache.cxx.
References any, Any, getCell(), getColSize(), getFieldName(), getRowSize(), i, isRowActive(), isRowQualified(), nTabSize, and pData.
Referenced by ScDatabaseDPData::GetDrillDownData(), and ScSheetDPData::GetDrillDownData().
|
inline |
Definition at line 108 of file dpfilteredcache.hxx.
References mrCache.
Referenced by ScDPGroupTableData::FillGroupValues(), ScDPTableData::FillRowDataFromCacheTable(), fillTable(), ScDPGroupDimension::GetColumnEntries(), ScDPTableData::GetFormattedString(), ScDPTableData::GetItemData(), ScDPTableData::GetMemberById(), ScDPTableData::GetMemberByIndex(), ScSheetDPData::GetNumberFormat(), ScSheetDPData::IsDateDimension(), and ScDPGroupTableData::ModifyFilterCriteria().
const ScDPItemData * ScDPFilteredCache::getCell | ( | SCCOL | nCol, |
SCROW | nRow, | ||
bool | bRepeatIfEmpty | ||
) | const |
Get the cell instance at specified location within the data grid.
Note that the data grid doesn't include the header row. Don't delete the returned object!
Definition at line 255 of file dpfilteredcache.cxx.
References ScDPCache::GetItemDataById(), ScDPCache::GetItemDataId(), mrCache, and nId.
Referenced by filterTable(), getValue(), and isRowQualified().
sal_Int32 ScDPFilteredCache::getColSize | ( | ) | const |
Definition at line 90 of file dpfilteredcache.cxx.
References ScDPCache::GetColumnCount(), and mrCache.
Referenced by fillTable(), filterTable(), ScDatabaseDPData::GetColumnCount(), ScSheetDPData::GetColumnCount(), ScSheetDPData::getDimensionName(), ScSheetDPData::getIsDataLayoutDimension(), ScSheetDPData::IsDateDimension(), and isRowQualified().
const ::std::vector< SCROW > & ScDPFilteredCache::getFieldEntries | ( | sal_Int32 | nColumn | ) | const |
Get the unique entries for a field specified by index.
The caller must make sure that the table is filled before calling function, or it will get an empty collection.
Definition at line 279 of file dpfilteredcache.cxx.
References maFieldEntries, and o3tl::make_unsigned().
Referenced by ScDPTableData::GetColumnEntries(), ScDPTableData::GetMemberByIndex(), and ScDPTableData::GetMembersCount().
OUString ScDPFilteredCache::getFieldName | ( | SCCOL | nIndex | ) | const |
Definition at line 274 of file dpfilteredcache.cxx.
References ScDPCache::GetDimensionName(), mrCache, and nIndex.
Referenced by filterTable(), ScDatabaseDPData::getDimensionName(), and ScSheetDPData::getDimensionName().
sal_Int32 ScDPFilteredCache::getRowSize | ( | ) | const |
Definition at line 85 of file dpfilteredcache.cxx.
References ScDPCache::GetRowCount(), and mrCache.
Referenced by ScDPGroupTableData::CalcResults(), ScDPTableData::CalcResultsFromCacheTable(), fillTable(), filterByPageDimension(), filterTable(), ScDatabaseDPData::GetDrillDownData(), and ScSheetDPData::GetDrillDownData().
Definition at line 261 of file dpfilteredcache.cxx.
References ScDPValue::Empty, getCell(), ScDPValue::meType, ScDPValue::mfValue, pData, and ScDPValue::Set().
Referenced by ScDPTableData::FillRowDataFromCacheTable().
bool ScDPFilteredCache::isRowActive | ( | sal_Int32 | nRow, |
sal_Int32 * | pLastRow = nullptr |
||
) | const |
Check whether a specified row is active or not.
When a row is active, it is used in calculation of the results data. A row becomes inactive when it is filtered out by page field.
Definition at line 216 of file dpfilteredcache.cxx.
References maShowByFilter, maShowByPage, and MAXROW.
Referenced by ScDPGroupTableData::CalcResults(), ScDPTableData::CalcResultsFromCacheTable(), and filterTable().
|
private |
Check if a given row meets all specified criteria.
nRow | index of row to be tested. |
rCriteria | a list of criteria |
Definition at line 370 of file dpfilteredcache.cxx.
References getCell(), and getColSize().
Referenced by filterByPageDimension(), and filterTable().
|
private |
unique field entries for each field (column).
Definition at line 165 of file dpfilteredcache.hxx.
Referenced by clear(), empty(), fillTable(), and getFieldEntries().
|
private |
Rows visible by standard filter query.
Definition at line 168 of file dpfilteredcache.hxx.
Referenced by clear(), fillTable(), and isRowActive().
|
private |
Rows visible by page dimension filtering.
Definition at line 170 of file dpfilteredcache.hxx.
Referenced by clear(), fillTable(), filterByPageDimension(), and isRowActive().
|
private |
Definition at line 172 of file dpfilteredcache.hxx.
Referenced by fillTable(), filterByPageDimension(), getCache(), getCell(), getColSize(), getFieldName(), and getRowSize().