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 48 of file dpcache.hxx.
typedef mdds::flat_segment_tree<SCROW, bool> ScDPCache::EmptyRowsType |
Definition at line 52 of file dpcache.hxx.
|
private |
Definition at line 120 of file dpcache.hxx.
|
private |
Definition at line 121 of file dpcache.hxx.
typedef std::vector<SCROW> ScDPCache::IndexArrayType |
Definition at line 55 of file dpcache.hxx.
typedef std::vector<ScDPItemData> ScDPCache::ScDPItemDataVec |
Definition at line 53 of file dpcache.hxx.
Definition at line 54 of file dpcache.hxx.
typedef std::unordered_set<OUString> ScDPCache::StringSetType |
Definition at line 51 of file dpcache.hxx.
|
delete |
ScDPCache::ScDPCache | ( | ScDocument & | rDoc | ) |
Definition at line 71 of file dpcache.cxx.
ScDPCache::~ScDPCache | ( | ) |
Definition at line 93 of file dpcache.cxx.
References o3tl::sorted_vector< Value, Compare, Find, class >::begin(), o3tl::sorted_vector< Value, Compare, Find, class >::end(), maRefObjects, and mbDisposing.
void ScDPCache::AddReference | ( | ScDPObject * | pObj | ) | const |
Definition at line 1103 of file dpcache.cxx.
References o3tl::sorted_vector< Value, Compare, Find, class >::insert(), and maRefObjects.
Referenced by ScDPObject::GetTableData().
tools::Long ScDPCache::AppendGroupField | ( | ) |
Definition at line 1266 of file dpcache.cxx.
References maFields, and maGroupFields.
Referenced by ScDPSaveGroupDimension::AddToCache().
|
private |
Definition at line 949 of file dpcache.cxx.
References maEmptyRows, maFields, maGroupFields, maLabelNames, maStringPools, mnColumnCount, and mnRowCount.
Referenced by InitFromDataBase(), and InitFromDoc().
void ScDPCache::ClearAllFields | ( | ) |
Definition at line 1364 of file dpcache.cxx.
References ClearGroupFields(), and maFields.
Referenced by ScDPCollection::ReloadGroupsInCache().
void ScDPCache::ClearGroupFields | ( | ) |
Definition at line 1359 of file dpcache.cxx.
References maGroupFields.
Referenced by ClearAllFields().
void ScDPCache::Dump | ( | ) | const |
const ScDPCache::ScDPObjectSet & ScDPCache::GetAllReferences | ( | ) | const |
Definition at line 1119 of file dpcache.cxx.
References maRefObjects.
Referenced by XclExpXmlPivotTableManager::Initialize(), XclExpXmlPivotCaches::SavePivotCacheXml(), ScDPCollection::SheetCaches::updateCache(), ScDPCollection::NameCaches::updateCache(), and ScDPCollection::DBCaches::updateCache().
tools::Long ScDPCache::GetColumnCount | ( | ) | const |
Definition at line 890 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 1038 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 1087 of file dpcache.cxx.
References i, and maLabelNames.
Referenced by ScDPSaveGroupDimension::AddToCache(), ScDPSaveNumGroupDimension::AddToCache(), and XclExpXmlPivotCaches::SavePivotCacheXml().
OUString ScDPCache::GetDimensionName | ( | std::vector< OUString >::size_type | nDim | ) | const |
Definition at line 918 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 1081 of file dpcache.cxx.
References maFields, and mnColumnCount.
Referenced by ScDPFilteredCache::fillTable().
const ScDPCache::ScDPItemDataVec & ScDPCache::GetDimMemberValues | ( | SCCOL | nDim | ) | const |
Definition at line 1052 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 885 of file dpcache.cxx.
References mrDoc.
Referenced by ScDPSaveGroupDimension::AddToCache(), ScDPSaveNumGroupDimension::AddToCache(), and InitFromDoc().
size_t ScDPCache::GetFieldCount | ( | ) | const |
Definition at line 1023 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 1044 of file dpcache.cxx.
References maFields.
OUString ScDPCache::GetFormattedString | ( | tools::Long | nDim, |
const ScDPItemData & | rItem, | ||
bool | bLocaleIndependent | ||
) | const |
Definition at line 1207 of file dpcache.cxx.
References aStr, eType, ScDPUtil::getDateGroupName(), ScDocument::GetFormatTable(), GetGroupItems(), ScDPItemData::GetGroupValue(), ScGlobal::getLocaleDataPtr(), GetLocaleIndependentFormattedNumberString(), GetLocaleIndependentFormattedString(), GetNumberFormat(), LocaleDataWrapper::getNumDecimalSep(), ScDPUtil::getNumGroupName(), SvNumberFormatter::GetOutputString(), ScDPItemData::GetString(), ScDPItemData::GetType(), ScDPItemData::GetValue(), ScDPItemData::GroupValue, ScDPCache::GroupItems::maInfo, ScDPNumGroupInfo::mfEnd, ScDPNumGroupInfo::mfStart, 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 1319 of file dpcache.cxx.
References i, maFields, and maGroupFields.
Referenced by ScDPGroupDimension::GetColumnEntries(), and ScDPNumGroupDimension::GetNumEntries().
size_t ScDPCache::GetGroupFieldCount | ( | ) | const |
Definition at line 1028 of file dpcache.cxx.
References maGroupFields.
Referenced by XclExpXmlPivotCaches::SavePivotCacheXml(), and XclExpXmlPivotTables::SavePivotTableXml().
|
private |
Definition at line 902 of file dpcache.cxx.
References 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 1391 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 1124 of file dpcache.cxx.
References i, maFields, maGroupFields, o3tl::make_unsigned(), and mnColumnCount.
Referenced by ScDPGroupTableData::FillGroupValues(), and ScDPMembers::getByIndex().
const ScDPItemData * ScDPCache::GetItemDataById | ( | tools::Long | nDim, |
SCROW | nId | ||
) | const |
Definition at line 985 of file dpcache.cxx.
References if(), maFields, maGroupFields, ScDPCache::Field::maItems, and ScDPCache::Field::mpGroup.
Referenced by ScDPGroupTableData::FillGroupValues(), ScDPFilteredCache::getCell(), ScDPTableData::GetMemberById(), ScDPTableData::GetMemberByIndex(), ScDPMember::IsNamedItem(), and ValidQuery().
Definition at line 960 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 1168 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 1188 of file dpcache.cxx.
Referenced by GetFormattedString(), and GetLocaleIndependentFormattedString().
|
static |
Definition at line 1194 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 1058 of file dpcache.cxx.
References maFields, and mnColumnCount.
Referenced by GetFormattedString(), and ScSheetDPData::GetNumberFormat().
SvNumberFormatter * ScDPCache::GetNumberFormatter | ( | ) | const |
Definition at line 1261 of file dpcache.cxx.
References ScDocument::GetFormatTable(), and mrDoc.
const ScDPNumGroupInfo * ScDPCache::GetNumGroupInfo | ( | tools::Long | nDim | ) | const |
Definition at line 1370 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 1033 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 Clear(), Exception, ScDPCache::DBConnector::finish(), ScDPCache::DBConnector::first(), ScDPCache::DBConnector::getColumnCount(), ScDocument::GetFormatTable(), SvNumberFormatter::GetStandardFormat(), ScDPCache::DBConnector::getValue(), i, ScDPItemData::IsEmpty(), maData, maEmptyRows, maFields, maLabelNames, maStringPools, mnColumnCount, ScDPCache::Field::mnNumFormat, mnRowCount, mrDoc, ScDPCache::DBConnector::next(), PostInit(), and ScDPItemData::SetEmpty().
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(), GetDoc(), ScDocument::GetSheetLimits(), i, maEmptyRows, maFields, maLabelNames, maStringPools, mnColumnCount, mnRowCount, pos, PostInit(), ScAddress::Row(), ScDocument::ShrinkToDataArea(), t, ScAddress::Tab(), and ValidRow().
Referenced by ScDPCollection::SheetCaches::updateCache(), and ScDPCollection::NameCaches::updateCache().
rtl_uString * ScDPCache::InternString | ( | size_t | nDim, |
const OUString & | rStr | ||
) |
Definition at line 1097 of file dpcache.cxx.
References assert(), and maStringPools.
bool ScDPCache::IsDateDimension | ( | tools::Long | nDim | ) | const |
Definition at line 1068 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 895 of file dpcache.cxx.
References maEmptyRows.
|
private |
Definition at line 931 of file dpcache.cxx.
References maEmptyRows, maFields, and mnDataSize.
Referenced by InitFromDataBase(), and InitFromDoc().
void ScDPCache::RemoveReference | ( | ScDPObject * | pObj | ) | const |
Definition at line 1108 of file dpcache.cxx.
References o3tl::sorted_vector< Value, Compare, Find, class >::empty(), o3tl::sorted_vector< Value, Compare, Find, class >::erase(), ScDocument::GetDPCollection(), maRefObjects, mbDisposing, mrDoc, and ScDPCollection::RemoveCache().
void ScDPCache::ResetGroupItems | ( | tools::Long | nDim, |
const ScDPNumGroupInfo & | rNumInfo, | ||
sal_Int32 | nGroupType | ||
) |
Definition at line 1272 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 1294 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 assert(), aStr, ScQueryParamBase::bCaseSens, ScQueryEntry::bDoQuery, ScQueryEntry::ByEmpty, ScQueryEntry::ByString, CollatorWrapper::compareString(), ScQueryEntry::eConnect, ScQueryEntry::eOp, ScQueryParamBase::eSearchType, ScGlobal::GetCaseCollator(), ScGlobal::GetCaseTransliteration(), ScGlobal::GetCollator(), ScDocument::GetDocOptions(), ScQueryParamBase::GetEntry(), ScQueryParamBase::GetEntryCount(), GetItemDataById(), GetItemDataId(), ScGlobal::GetpTransliteration(), ScQueryEntry::GetQueryItem(), ScQueryEntry::GetSearchTextPtr(), svl::SharedString::getString(), ScDPItemData::GetString(), 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, 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(), utl::TransliterationWrapper::transliterate(), and ScGlobal::xSysLocale.
|
private |
Definition at line 128 of file dpcache.hxx.
Referenced by Clear(), InitFromDataBase(), InitFromDoc(), IsRowEmpty(), and PostInit().
|
private |
Definition at line 123 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 124 of file dpcache.hxx.
Referenced by AppendGroupField(), Clear(), ClearGroupFields(), GetGroupDimMemberIds(), GetGroupFieldCount(), GetGroupItems(), GetGroupType(), GetIdByItemData(), GetItemDataById(), GetNumGroupInfo(), ResetGroupItems(), and SetGroupItem().
|
private |
Definition at line 127 of file dpcache.hxx.
Referenced by Clear(), GetDimensionIndex(), GetDimensionName(), InitFromDataBase(), and InitFromDoc().
|
mutableprivate |
All pivot table objects that references this cache.
Definition at line 118 of file dpcache.hxx.
Referenced by AddReference(), GetAllReferences(), RemoveReference(), and ~ScDPCache().
|
private |
Definition at line 125 of file dpcache.hxx.
Referenced by Clear(), InitFromDataBase(), InitFromDoc(), and InternString().
|
private |
Definition at line 132 of file dpcache.hxx.
Referenced by RemoveReference(), and ~ScDPCache().
|
private |
Definition at line 113 of file dpcache.hxx.
Referenced by Clear(), GetColumnCount(), GetDimensionName(), GetDimMemberCount(), GetDimMemberValues(), GetIdByItemData(), GetItemDataId(), GetNumberFormat(), InitFromDataBase(), InitFromDoc(), and IsDateDimension().
|
private |
Definition at line 129 of file dpcache.hxx.
Referenced by GetDataSize(), and PostInit().
|
private |
Definition at line 130 of file dpcache.hxx.
Referenced by Clear(), GetRowCount(), InitFromDataBase(), and InitFromDoc().
|
private |
Definition at line 112 of file dpcache.hxx.
Referenced by GetDoc(), GetFormattedString(), GetNumberFormatter(), InitFromDataBase(), IsDateDimension(), RemoveReference(), and ValidQuery().