LibreOffice Module sc (master) 1
|
This class represents the cached data part of the datapilot cache table implementation. More...
#include <dpcache.hxx>
Classes | |
class | DBConnector |
Interface for connecting to database source. More... | |
struct | Field |
struct | GroupItems |
Public Types | |
typedef std::unordered_set< OUString > | StringSetType |
typedef mdds::flat_segment_tree< SCROW, bool > | EmptyRowsType |
typedef std::vector< ScDPItemData > | ScDPItemDataVec |
typedef o3tl::sorted_vector< ScDPObject * > | ScDPObjectSet |
typedef std::vector< SCROW > | IndexArrayType |
Public Member Functions | |
rtl_uString * | InternString (size_t nDim, const OUString &rStr) |
void | AddReference (ScDPObject *pObj) const |
void | RemoveReference (ScDPObject *pObj) const |
const ScDPObjectSet & | GetAllReferences () const |
SCROW | GetIdByItemData (tools::Long nDim, const ScDPItemData &rItem) const |
OUString | GetFormattedString (tools::Long nDim, const ScDPItemData &rItem, bool bLocaleIndependent) const |
SvNumberFormatter * | GetNumberFormatter () const |
tools::Long | AppendGroupField () |
void | ResetGroupItems (tools::Long nDim, const ScDPNumGroupInfo &rNumInfo, sal_Int32 nGroupType) |
SCROW | SetGroupItem (tools::Long nDim, const ScDPItemData &rData) |
void | GetGroupDimMemberIds (tools::Long nDim, std::vector< SCROW > &rIds) const |
void | ClearGroupFields () |
void | ClearAllFields () |
const ScDPNumGroupInfo * | GetNumGroupInfo (tools::Long nDim) const |
sal_Int32 | GetGroupType (tools::Long nDim) const |
Return a group type identifier. More... | |
SCCOL | GetDimensionIndex (std::u16string_view sName) const |
sal_uInt32 | GetNumberFormat (tools::Long nDim) const |
bool | IsDateDimension (tools::Long nDim) const |
tools::Long | GetDimMemberCount (tools::Long nDim) const |
const IndexArrayType * | GetFieldIndexArray (size_t nDim) const |
const ScDPItemDataVec & | GetDimMemberValues (SCCOL nDim) const |
void | InitFromDoc (ScDocument &rDoc, const ScRange &rRange) |
bool | InitFromDataBase (DBConnector &rDB) |
SCROW | GetRowCount () const |
Row count is the number of records plus any trailing empty rows in case the source data is sheet and contains trailing empty rows. More... | |
SCROW | GetDataSize () const |
Data size is the number of records without any trailing empty rows for sheet source data. More... | |
SCROW | GetItemDataId (sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty) const |
OUString | GetDimensionName (std::vector< OUString >::size_type nDim) const |
bool | IsRowEmpty (SCROW nRow) const |
bool | ValidQuery (SCROW nRow, const ScQueryParam &rQueryParam) const |
ScDocument & | GetDoc () const |
tools::Long | GetColumnCount () const |
const ScDPItemData * | GetItemDataById (tools::Long nDim, SCROW nId) const |
size_t | GetFieldCount () const |
size_t | GetGroupFieldCount () const |
ScDPCache (const ScDPCache &)=delete | |
const ScDPCache & | operator= (const ScDPCache &)=delete |
ScDPCache (ScDocument &rDoc) | |
~ScDPCache () | |
void | Dump () const |
Static Public Member Functions | |
static sal_uInt32 | GetLocaleIndependentFormat (SvNumberFormatter &rFormatter, sal_uInt32 nNumFormat) |
static OUString | GetLocaleIndependentFormattedNumberString (double fValue) |
static OUString | GetLocaleIndependentFormattedString (double fValue, SvNumberFormatter &rFormatter, sal_uInt32 nNumFormat) |
Private Types | |
typedef std::vector< std::unique_ptr< Field > > | FieldsType |
typedef std::vector< std::unique_ptr< GroupItems > > | GroupFieldsType |
Private Member Functions | |
void | PostInit () |
void | Clear () |
const GroupItems * | GetGroupItems (tools::Long nDim) const |
Private Attributes | |
ScDocument & | mrDoc |
SCCOL | mnColumnCount |
ScDPObjectSet | maRefObjects |
All pivot table objects that references this cache. More... | |
FieldsType | maFields |
GroupFieldsType | maGroupFields |
std::vector< StringSetType > | maStringPools |
std::vector< OUString > | maLabelNames |
EmptyRowsType | maEmptyRows |
SCROW | mnDataSize |
SCROW | mnRowCount |
bool | mbDisposing |
This class represents the cached data part of the datapilot cache table implementation.
Definition at line 47 of file dpcache.hxx.
typedef mdds::flat_segment_tree<SCROW, bool> ScDPCache::EmptyRowsType |
Definition at line 51 of file dpcache.hxx.
|
private |
Definition at line 119 of file dpcache.hxx.
|
private |
Definition at line 120 of file dpcache.hxx.
typedef std::vector<SCROW> ScDPCache::IndexArrayType |
Definition at line 54 of file dpcache.hxx.
typedef std::vector<ScDPItemData> ScDPCache::ScDPItemDataVec |
Definition at line 52 of file dpcache.hxx.
Definition at line 53 of file dpcache.hxx.
typedef std::unordered_set<OUString> ScDPCache::StringSetType |
Definition at line 50 of file dpcache.hxx.
|
delete |
ScDPCache::ScDPCache | ( | ScDocument & | rDoc | ) |
Definition at line 72 of file dpcache.cxx.
ScDPCache::~ScDPCache | ( | ) |
Definition at line 94 of file dpcache.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::begin(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::end(), maRefObjects, and mbDisposing.
void ScDPCache::AddReference | ( | ScDPObject * | pObj | ) | const |
Definition at line 1101 of file dpcache.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::insert(), and maRefObjects.
Referenced by ScDPObject::GetTableData().
tools::Long ScDPCache::AppendGroupField | ( | ) |
Definition at line 1264 of file dpcache.cxx.
References maFields, and maGroupFields.
Referenced by ScDPSaveGroupDimension::AddToCache().
|
private |
Definition at line 947 of file dpcache.cxx.
References maEmptyRows, maFields, maGroupFields, maLabelNames, maStringPools, mnColumnCount, and mnRowCount.
Referenced by InitFromDataBase(), and InitFromDoc().
void ScDPCache::ClearAllFields | ( | ) |
Definition at line 1362 of file dpcache.cxx.
References ClearGroupFields(), and maFields.
Referenced by ScDPCollection::ReloadGroupsInCache().
void ScDPCache::ClearGroupFields | ( | ) |
Definition at line 1357 of file dpcache.cxx.
References maGroupFields.
Referenced by ClearAllFields().
void ScDPCache::Dump | ( | ) | const |
References Clear().
const ScDPCache::ScDPObjectSet & ScDPCache::GetAllReferences | ( | ) | const |
Definition at line 1117 of file dpcache.cxx.
References maRefObjects.
Referenced by XclExpXmlPivotTableManager::Initialize(), XclExpXmlPivotCaches::SavePivotCacheXml(), ScDPCollection::NameCaches::updateCache(), ScDPCollection::SheetCaches::updateCache(), and ScDPCollection::DBCaches::updateCache().
tools::Long ScDPCache::GetColumnCount | ( | ) | const |
Definition at line 888 of file dpcache.cxx.
References mnColumnCount.
Referenced by ScDPTableData::FillRowDataFromCacheTable(), ScDPFilteredCache::getColSize(), and ScDPTableData::GetItemData().
SCROW ScDPCache::GetDataSize | ( | ) | const |
Data size is the number of records without any trailing empty rows for sheet source data.
For any other source type, this should equal the row count.
Definition at line 1036 of file dpcache.cxx.
References GetRowCount(), and mnDataSize.
Referenced by ScDPFilteredCache::fillTable(), ScDPFilteredCache::filterByPageDimension(), and XclExpXmlPivotCaches::SavePivotCacheXml().
SCCOL ScDPCache::GetDimensionIndex | ( | std::u16string_view | sName | ) | const |
Definition at line 1085 of file dpcache.cxx.
References i, maLabelNames, and sName.
Referenced by ScDPSaveGroupDimension::AddToCache(), ScDPSaveNumGroupDimension::AddToCache(), and XclExpXmlPivotCaches::SavePivotCacheXml().
OUString ScDPCache::GetDimensionName | ( | std::vector< OUString >::size_type | nDim | ) | const |
Definition at line 916 of file dpcache.cxx.
References maLabelNames, and mnColumnCount.
Referenced by ScDPFilteredCache::getFieldName(), and XclExpXmlPivotCaches::SavePivotCacheXml().
tools::Long ScDPCache::GetDimMemberCount | ( | tools::Long | nDim | ) | const |
Definition at line 1079 of file dpcache.cxx.
References maFields, and mnColumnCount.
Referenced by ScDPFilteredCache::fillTable().
const ScDPCache::ScDPItemDataVec & ScDPCache::GetDimMemberValues | ( | SCCOL | nDim | ) | const |
Definition at line 1050 of file dpcache.cxx.
References maFields, and mnColumnCount.
Referenced by ScDPSaveGroupDimension::AddToCache(), ScDPSaveNumGroupDimension::AddToCache(), XclExpXmlPivotCaches::SavePivotCacheXml(), and XclExpXmlPivotTables::SavePivotTableXml().
ScDocument & ScDPCache::GetDoc | ( | ) | const |
Definition at line 883 of file dpcache.cxx.
References mrDoc.
Referenced by ScDPSaveGroupDimension::AddToCache(), ScDPSaveNumGroupDimension::AddToCache(), and InitFromDoc().
size_t ScDPCache::GetFieldCount | ( | ) | const |
Definition at line 1021 of file dpcache.cxx.
References maFields.
Referenced by XclExpXmlPivotCaches::SavePivotCacheXml(), and XclExpXmlPivotTables::SavePivotTableXml().
const ScDPCache::IndexArrayType * ScDPCache::GetFieldIndexArray | ( | size_t | nDim | ) | const |
Definition at line 1042 of file dpcache.cxx.
References maFields.
OUString ScDPCache::GetFormattedString | ( | tools::Long | nDim, |
const ScDPItemData & | rItem, | ||
bool | bLocaleIndependent | ||
) | const |
Definition at line 1205 of file dpcache.cxx.
References aStr, eType, ScDPUtil::getDateGroupName(), ScDocument::GetFormatTable(), GetGroupItems(), ScDPItemData::GetGroupValue(), ScGlobal::getLocaleData(), GetLocaleIndependentFormattedNumberString(), GetLocaleIndependentFormattedString(), GetNumberFormat(), LocaleDataWrapper::getNumDecimalSep(), ScDPUtil::getNumGroupName(), SvNumberFormatter::GetOutputString(), ScDPItemData::GetString(), ScDPItemData::GetType(), ScDPItemData::GetValue(), ScDPItemData::GroupValue, ScDPItemData::GroupValueAttr::mnGroupType, ScDPItemData::GroupValueAttr::mnValue, mrDoc, p, ScDPItemData::RangeStart, and ScDPItemData::Value.
Referenced by ScDPTableData::GetFormattedString(), and XclExpPCField::InsertNumDateGroupItems().
void ScDPCache::GetGroupDimMemberIds | ( | tools::Long | nDim, |
std::vector< SCROW > & | rIds | ||
) | const |
Definition at line 1317 of file dpcache.cxx.
References i, maFields, maGroupFields, and n.
Referenced by ScDPGroupDimension::GetColumnEntries(), and ScDPNumGroupDimension::GetNumEntries().
size_t ScDPCache::GetGroupFieldCount | ( | ) | const |
Definition at line 1026 of file dpcache.cxx.
References maGroupFields.
Referenced by XclExpXmlPivotCaches::SavePivotCacheXml(), and XclExpXmlPivotTables::SavePivotTableXml().
|
private |
Definition at line 900 of file dpcache.cxx.
References get(), maFields, and maGroupFields.
Referenced by GetFormattedString().
sal_Int32 ScDPCache::GetGroupType | ( | tools::Long | nDim | ) | const |
Return a group type identifier.
The values correspond with css::sheet::DataPilotFieldGroupBy constant values.
nDim | 0-based dimension index. |
Definition at line 1389 of file dpcache.cxx.
References maFields, and maGroupFields.
Referenced by ScDPGroupTableData::FillGroupValues(), XclExpXmlPivotCaches::SavePivotCacheXml(), and XclExpXmlPivotTables::SavePivotTableXml().
SCROW ScDPCache::GetIdByItemData | ( | tools::Long | nDim, |
const ScDPItemData & | rItem | ||
) | const |
Definition at line 1122 of file dpcache.cxx.
References i, maFields, maGroupFields, o3tl::make_unsigned(), mnColumnCount, and n.
Referenced by ScDPGroupTableData::FillGroupValues(), and ScDPMembers::getByIndex().
const ScDPItemData * ScDPCache::GetItemDataById | ( | tools::Long | nDim, |
SCROW | nId | ||
) | const |
Definition at line 983 of file dpcache.cxx.
References if(), maFields, maGroupFields, ScDPCache::Field::maItems, ScDPCache::Field::mpGroup, and nId.
Referenced by ScDPGroupTableData::FillGroupValues(), ScDPFilteredCache::getCell(), ScDPTableData::GetMemberById(), ScDPTableData::GetMemberByIndex(), ScDPMember::IsNamedItem(), and ValidQuery().
Definition at line 958 of file dpcache.cxx.
References ScDPCache::Field::maData, maFields, ScDPCache::Field::maItems, o3tl::make_unsigned(), and mnColumnCount.
Referenced by ScDPFilteredCache::fillTable(), ScDPFilteredCache::getCell(), ScDPTableData::GetItemData(), and ValidQuery().
|
static |
Definition at line 1166 of file dpcache.cxx.
References SvNumberFormatter::GetFormatIndex(), SvNumberFormatter::GetType(), LANGUAGE_ENGLISH_US, NF_DATE_ISO_YYYYMMDD, NF_DATETIME_ISO_YYYYMMDD_HHMMSS, NF_NUMBER_STANDARD, and NF_TIME_HHMMSS.
Referenced by GetLocaleIndependentFormattedString().
|
static |
Definition at line 1186 of file dpcache.cxx.
Referenced by GetFormattedString(), and GetLocaleIndependentFormattedString().
|
static |
Definition at line 1192 of file dpcache.cxx.
References aStr, GetLocaleIndependentFormat(), GetLocaleIndependentFormattedNumberString(), SvNumberFormatter::GetOutputString(), and SV_COUNTRY_LANGUAGE_OFFSET.
Referenced by GetFormattedString(), ScDPObject::ParseFilters(), and ScInterpreter::ScGetPivotData().
sal_uInt32 ScDPCache::GetNumberFormat | ( | tools::Long | nDim | ) | const |
Definition at line 1056 of file dpcache.cxx.
References maFields, and mnColumnCount.
Referenced by GetFormattedString(), and ScSheetDPData::GetNumberFormat().
SvNumberFormatter * ScDPCache::GetNumberFormatter | ( | ) | const |
Definition at line 1259 of file dpcache.cxx.
References ScDocument::GetFormatTable(), and mrDoc.
const ScDPNumGroupInfo * ScDPCache::GetNumGroupInfo | ( | tools::Long | nDim | ) | const |
Definition at line 1368 of file dpcache.cxx.
References maFields, and maGroupFields.
Referenced by ScDPGroupTableData::FillGroupValues(), ScDPGroupTableData::ModifyFilterCriteria(), and XclExpXmlPivotCaches::SavePivotCacheXml().
SCROW ScDPCache::GetRowCount | ( | ) | const |
Row count is the number of records plus any trailing empty rows in case the source data is sheet and contains trailing empty rows.
Definition at line 1031 of file dpcache.cxx.
References mnRowCount.
Referenced by GetDataSize(), and ScDPFilteredCache::getRowSize().
bool ScDPCache::InitFromDataBase | ( | DBConnector & | rDB | ) |
Definition at line 626 of file dpcache.cxx.
References aData, Clear(), Exception, ScDPCache::DBConnector::finish(), ScDPCache::DBConnector::first(), ScDPCache::DBConnector::getColumnCount(), ScDocument::GetFormatTable(), SvNumberFormatter::GetStandardFormat(), ScDPCache::DBConnector::getValue(), i, maEmptyRows, maFields, maLabelNames, maStringPools, mnColumnCount, ScDPCache::Field::mnNumFormat, mnRowCount, mrDoc, ScDPCache::DBConnector::next(), and PostInit().
Referenced by ScDPCollection::DBCaches::updateCache().
void ScDPCache::InitFromDoc | ( | ScDocument & | rDoc, |
const ScRange & | rRange | ||
) |
Definition at line 510 of file dpcache.cxx.
References ScRange::aEnd, ScRange::aStart, Clear(), ScAddress::Col(), ScDocument::EnsureFormulaCellResults(), get(), GetDoc(), ScDocument::GetSheetLimits(), i, maEmptyRows, maFields, maLabelNames, maStringPools, mnColumnCount, mnRowCount, pos, PostInit(), ScAddress::Row(), ScDocument::ShrinkToDataArea(), t, ScAddress::Tab(), and ValidRow().
Referenced by ScDPCollection::NameCaches::updateCache(), and ScDPCollection::SheetCaches::updateCache().
rtl_uString * ScDPCache::InternString | ( | size_t | nDim, |
const OUString & | rStr | ||
) |
Definition at line 1095 of file dpcache.cxx.
References maStringPools.
bool ScDPCache::IsDateDimension | ( | tools::Long | nDim | ) | const |
Definition at line 1066 of file dpcache.cxx.
References eType, ScDocument::GetFormatTable(), SvNumberFormatter::GetType(), maFields, mnColumnCount, and mrDoc.
Referenced by ScSheetDPData::IsDateDimension(), and XclExpXmlPivotCaches::SavePivotCacheXml().
bool ScDPCache::IsRowEmpty | ( | SCROW | nRow | ) | const |
Definition at line 893 of file dpcache.cxx.
References maEmptyRows.
|
private |
Definition at line 929 of file dpcache.cxx.
References maEmptyRows, maFields, and mnDataSize.
Referenced by InitFromDataBase(), and InitFromDoc().
void ScDPCache::RemoveReference | ( | ScDPObject * | pObj | ) | const |
Definition at line 1106 of file dpcache.cxx.
References o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::empty(), o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::erase(), ScDocument::GetDPCollection(), maRefObjects, mbDisposing, mrDoc, and ScDPCollection::RemoveCache().
void ScDPCache::ResetGroupItems | ( | tools::Long | nDim, |
const ScDPNumGroupInfo & | rNumInfo, | ||
sal_Int32 | nGroupType | ||
) |
Definition at line 1270 of file dpcache.cxx.
References maFields, maGroupFields, ScDPCache::GroupItems::maInfo, ScDPCache::GroupItems::maItems, and ScDPCache::GroupItems::mnGroupType.
Referenced by ScDPSaveGroupDimension::AddToCache(), and ScDPSaveNumGroupDimension::AddToCache().
SCROW ScDPCache::SetGroupItem | ( | tools::Long | nDim, |
const ScDPItemData & | rData | ||
) |
Definition at line 1292 of file dpcache.cxx.
References maFields, maGroupFields, ScDPCache::GroupItems::maItems, and nId.
Referenced by ScDPSaveGroupDimension::AddToCache(), and ScDPSaveNumGroupDimension::AddToCache().
bool ScDPCache::ValidQuery | ( | SCROW | nRow, |
const ScQueryParam & | rQueryParam | ||
) | const |
Definition at line 686 of file dpcache.cxx.
References aStr, ScQueryParamBase::bCaseSens, ScQueryEntry::bDoQuery, ScQueryEntry::ByEmpty, ScQueryEntry::ByString, CollatorWrapper::compareString(), ScQueryEntry::eConnect, ScQueryEntry::eOp, ScQueryParamBase::eSearchType, ScGlobal::GetCollator(), ScDocument::GetDocOptions(), ScQueryParamBase::GetEntry(), ScQueryParamBase::GetEntryCount(), GetItemDataById(), GetItemDataId(), ScQueryEntry::GetQueryItem(), ScQueryEntry::GetSearchTextPtr(), svl::SharedString::getString(), ScDPItemData::GetString(), ScGlobal::GetTransliteration(), ScDPItemData::GetValue(), ScDPItemData::HasStringData(), i, ScDPItemData::IsEmpty(), utl::TransliterationWrapper::isEqual(), ScDocOptions::IsMatchWholeCell(), ScQueryEntry::IsQueryByEmpty(), ScQueryEntry::IsQueryByNonEmpty(), ScDPItemData::IsValue(), ScQueryEntry::Item::maString, ScQueryEntry::Item::meType, ScQueryEntry::Item::mfVal, mrDoc, ScQueryParamTable::nCol1, ScQueryParamTable::nCol2, ScQueryEntry::nField, nId, nIndex, utl::SearchParam::Normal, nPos, ScGlobal::oSysLocale, SC_AND, SC_BOTPERC, SC_BOTVAL, SC_EQUAL, SC_GREATER, SC_GREATER_EQUAL, SC_LESS, SC_LESS_EQUAL, SC_NOT_EQUAL, SC_TOPPERC, SC_TOPVAL, utl::TextSearch::SearchForward(), and utl::TransliterationWrapper::transliterate().
|
private |
Definition at line 127 of file dpcache.hxx.
Referenced by Clear(), InitFromDataBase(), InitFromDoc(), IsRowEmpty(), and PostInit().
|
private |
Definition at line 122 of file dpcache.hxx.
Referenced by AppendGroupField(), Clear(), ClearAllFields(), GetDimMemberCount(), GetDimMemberValues(), GetFieldCount(), GetFieldIndexArray(), GetGroupDimMemberIds(), GetGroupItems(), GetGroupType(), GetIdByItemData(), GetItemDataById(), GetItemDataId(), GetNumberFormat(), GetNumGroupInfo(), InitFromDataBase(), InitFromDoc(), IsDateDimension(), PostInit(), ResetGroupItems(), and SetGroupItem().
|
private |
Definition at line 123 of file dpcache.hxx.
Referenced by AppendGroupField(), Clear(), ClearGroupFields(), GetGroupDimMemberIds(), GetGroupFieldCount(), GetGroupItems(), GetGroupType(), GetIdByItemData(), GetItemDataById(), GetNumGroupInfo(), ResetGroupItems(), and SetGroupItem().
|
private |
Definition at line 126 of file dpcache.hxx.
Referenced by Clear(), GetDimensionIndex(), GetDimensionName(), InitFromDataBase(), and InitFromDoc().
|
mutableprivate |
All pivot table objects that references this cache.
Definition at line 117 of file dpcache.hxx.
Referenced by AddReference(), GetAllReferences(), RemoveReference(), and ~ScDPCache().
|
private |
Definition at line 124 of file dpcache.hxx.
Referenced by Clear(), InitFromDataBase(), InitFromDoc(), and InternString().
|
private |
Definition at line 131 of file dpcache.hxx.
Referenced by RemoveReference(), and ~ScDPCache().
|
private |
Definition at line 112 of file dpcache.hxx.
Referenced by Clear(), GetColumnCount(), GetDimensionName(), GetDimMemberCount(), GetDimMemberValues(), GetIdByItemData(), GetItemDataId(), GetNumberFormat(), InitFromDataBase(), InitFromDoc(), and IsDateDimension().
|
private |
Definition at line 128 of file dpcache.hxx.
Referenced by GetDataSize(), and PostInit().
|
private |
Definition at line 129 of file dpcache.hxx.
Referenced by Clear(), GetRowCount(), InitFromDataBase(), and InitFromDoc().
|
private |
Definition at line 111 of file dpcache.hxx.
Referenced by GetDoc(), GetFormattedString(), GetNumberFormatter(), InitFromDataBase(), IsDateDimension(), RemoveReference(), and ValidQuery().