28#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
29#include <com/sun/star/sheet/DataPilotFieldReference.hpp>
32#include <unordered_map>
33#include <unordered_set>
216#define SC_DPMEASURE_ALL -1
217#define SC_DPMEASURE_ANY -2
246 const ::std::vector<ScDPDimension*>&
mppDim;
253 LateInitParams( const ::std::vector<ScDPDimension*>& ppDim, const ::std::vector<ScDPLevel*>& ppLev,
265 bool IsEnd(
size_t nPos )
const ;
292 std::vector<ScSubTotalFunc>& rFunctions,
293 std::vector<css::sheet::DataPilotFieldReference>& rRefs,
294 std::vector<css::sheet::DataPilotFieldOrientation>& rRefOrient,
295 std::vector<OUString>& rNames );
348 void InitFrom( const ::std::vector<ScDPDimension*>& ppDim,
349 const ::std::vector<ScDPLevel*>& ppLev,
352 bool bInitChild =
true );
355 const ::std::vector< SCROW >& pItemData,
374 bool IsValidEntry( const ::std::vector< SCROW >& aMembers )
const;
379 void ProcessData( const ::std::vector<SCROW>& aChildMembers,
381 const ::std::vector<SCROW>& aDataMembers,
382 const ::std::vector<ScDPValue>& aValues );
384 css::uno::Sequence< css::sheet::MemberResult>* pSequences,
385 tools::Long& rPos,
tools::Long nMeasure,
bool bRoot,
const OUString* pMemberName,
const OUString* pMemberCaption );
390 css::uno::Sequence< css::uno::Sequence< css::sheet::DataResult> >& rSequence,
430 std::unique_ptr<ScDPDataDimension>
449 void ProcessData( const ::std::vector< SCROW >& aChildMembers, const ::std::vector<ScDPValue>& aValues,
459 css::uno::Sequence<css::sheet::DataResult>& rSequence,
489 typedef std::vector<std::unique_ptr<ScDPResultMember>>
MemberArray;
511 const ::std::vector< SCROW >& pItemData,
520 const ::std::vector<ScDPDimension*>& ppDim, const ::std::vector<ScDPLevel*>& ppLev,
521 size_t nPos,
ScDPInitState& rInitState,
bool bInitChild =
true );
523 const ::std::vector< SCROW >& pItemData,
530 bool IsValidEntry( const ::std::vector<SCROW>& aMembers )
const;
533 void ProcessData( const ::std::vector<SCROW>& aMembers,
535 const ::std::vector<SCROW>& aDataMembers,
536 const ::std::vector<ScDPValue>& aValues )
const;
538 css::sheet::MemberResult>* pSequences,
546 css::sheet::DataResult> >& rSequence,
563 const sal_Int32* pRowIndexes,
const sal_Int32* pColIndexes )
const;
613 void ProcessData( const ::std::vector< SCROW >& aDataMembers, const ::std::vector<ScDPValue>& aValues,
618 css::uno::Sequence<css::sheet::DataResult>& rSequence,
655 void fillFieldFilters(::std::vector<ScDPFilteredCache::Criterion>& rFilters)
const;
bool IsEnd(size_t nPos) const
void SetInitChild(bool b)
LateInitParams(const ::std::vector< ScDPDimension * > &ppDim, const ::std::vector< ScDPLevel * > &ppLev, bool bRow)
bool GetInitChild() const
const ::std::vector< ScDPDimension * > & mppDim
const ::std::vector< ScDPLevel * > & mppLev
ScDPDimension * GetDim(size_t nPos) const
void SetInitAllChildren(bool b)
ScDPLevel * GetLevel(size_t nPos) const
bool GetInitAllChild() const
bool mbHasHideDetailsMember
std::unordered_map< SCROW, ScDPParentDimData > maMemberHash
void SetHasHideDetailsMembers(bool b)
const ScDPParentDimData * FindMember(SCROW nIndex) const
bool IsHasHideDetailsMembers() const
void InsertMember(ScDPParentDimData const &rNew)
bool IsCalculated() const
std::vector< double > mSortedValues
void Update(const ScDPValue &rNext, ScSubTotalFunc eFunc, const ScDPSubTotalState &rSubState)
const ScDPAggData * GetExistingChild() const
void Dump(int nIndent) const
std::unique_ptr< ScDPAggData > pChild
void Calculate(ScSubTotalFunc eFunc, const ScDPSubTotalState &rSubState)
double GetAuxiliary() const
void SetAuxiliary(double fNew)
void SetResult(double fNew)
void UpdateDataRow(const ScDPResultDimension *pRefDim, tools::Long nMeasure, bool bIsSubTotalRow, const ScDPSubTotalState &rSubState) const
const ScDPResultData * pResultData
void DoAutoShow(ScDPResultDimension *pRefDim)
tools::Long GetSortedIndex(tools::Long nUnsorted) const
ScDPDataDimension(const ScDPResultData *pData)
or ptr to IntDimension?
void UpdateRunningTotals(const ScDPResultDimension *pRefDim, tools::Long nMeasure, bool bIsSubTotalRow, const ScDPSubTotalState &rSubState, ScDPRunningTotalState &rRunning, ScDPRowTotals &rTotals, const ScDPResultMember &rRowParent) const
const ScDPResultDimension * pResultDimension
std::vector< std::unique_ptr< ScDPDataMember > > maMembers
void SortMembers(ScDPResultDimension *pRefDim)
void ProcessData(const ::std::vector< SCROW > &aDataMembers, const ::std::vector< ScDPValue > &aValues, const ScDPSubTotalState &rSubState)
void DumpState(const ScDPResultDimension *pRefDim, ScDocument *pDoc, ScAddress &rPos) const
void Dump(int nIndent) const
tools::Long GetMemberCount() const
const ScDPDataMember * GetMember(tools::Long n) const
void FillDataRow(const ScDPResultDimension *pRefDim, ScDPResultFilterContext &rFilterCxt, css::uno::Sequence< css::sheet::DataResult > &rSequence, tools::Long nMeasure, bool bIsSubTotalRow, const ScDPSubTotalState &rSubState) const
void InitFrom(const ScDPResultDimension *pDim)
void UpdateValues(const ::std::vector< ScDPValue > &aValues, const ScDPSubTotalState &rSubState)
void Dump(int nIndent) const
const ScDPResultMember * pResultMember
ScDPAggData * GetAggData(tools::Long nMeasure, const ScDPSubTotalState &rSubState)
void SortMembers(ScDPResultMember *pRefMember)
bool HasHiddenDetails() const
void InitFrom(const ScDPResultDimension *pDim)
ScDPDataMember(const ScDPResultData *pData, const ScDPResultMember *pRes)
void UpdateRunningTotals(const ScDPResultMember *pRefMember, tools::Long nMeasure, bool bIsSubTotalRow, const ScDPSubTotalState &rSubState, ScDPRunningTotalState &rRunning, ScDPRowTotals &rTotals, const ScDPResultMember &rRowParent)
bool HasError(tools::Long nMeasure, const ScDPSubTotalState &rSubState) const
void UpdateDataRow(const ScDPResultMember *pRefMember, tools::Long nMeasure, bool bIsSubTotalRow, const ScDPSubTotalState &rSubState)
void ProcessData(const ::std::vector< SCROW > &aChildMembers, const ::std::vector< ScDPValue > &aValues, const ScDPSubTotalState &rSubState)
void DumpState(const ScDPResultMember *pRefMember, ScDocument *pDoc, ScAddress &rPos) const
void DoAutoShow(ScDPResultMember *pRefMember)
ScDPDataDimension * GetChildDimension()
double GetAggregate(tools::Long nMeasure, const ScDPSubTotalState &rSubState) const
const ScDPDataDimension * GetChildDimension() const
this will be removed!
bool IsNamedItem(SCROW nRow) const
const ScDPResultData * pResultData
bool HasData(tools::Long nMeasure, const ScDPSubTotalState &rSubState) const
std::unique_ptr< ScDPDataDimension > pChildDimension
Ref?
const ScDPAggData * GetConstAggData(tools::Long nMeasure, const ScDPSubTotalState &rSubState) const
void FillDataRow(const ScDPResultMember *pRefMember, ScDPResultFilterContext &rFilterCxt, css::uno::Sequence< css::sheet::DataResult > &rSequence, tools::Long nMeasure, bool bIsSubTotalRow, const ScDPSubTotalState &rSubState) const
Member names that are being processed for InitFrom/LateInitFrom (needed for initialization of grouped...
const std::vector< Member > & GetMembers() const
void AddMember(tools::Long nSourceIndex, SCROW nMember)
std::vector< Member > maMembers
When assigning a string value, you can also assign an interned string whose life-cycle is managed by ...
The term 'measure' here roughly equals "data dimension" ?
void SetDataLayoutOrientation(css::sheet::DataPilotFieldOrientation nOrient)
bool IsNumOrDateGroup(tools::Long nDim) const
tools::Long GetGroupBase(tools::Long nGroupDim) const
css::sheet::DataPilotFieldOrientation GetMeasureRefOrient(tools::Long nMeasure) const
void SetMeasureData(std::vector< ScSubTotalFunc > &rFunctions, std::vector< css::sheet::DataPilotFieldReference > &rRefs, std::vector< css::sheet::DataPilotFieldOrientation > &rRefOrient, std::vector< OUString > &rNames)
ScSubTotalFunc GetMeasureFunction(tools::Long nMeasure) const
std::vector< css::sheet::DataPilotFieldReference > maMeasureRefs
ScDPResultData(ScDPSource &rSrc)
const css::sheet::DataPilotFieldReference & GetMeasureRefVal(tools::Long nMeasure) const
tools::Long GetCountForMeasure(tools::Long nMeas) const
void SetLateInit(bool bSet)
OUString GetMeasureString(tools::Long nMeasure, bool bForce, ScSubTotalFunc eForceFunc, bool &rbTotalResult) const
tools::Long GetRowStartMeasure() const
OUString GetMeasureDimensionName(tools::Long nMeasure) const
std::vector< ScSubTotalFunc > maMeasureFuncs
keep things like measure lists here
tools::Long GetMeasureCount() const
std::vector< std::unique_ptr< ResultMembers > > maDimMembers
add "displayed values" settings
bool HasCommonElement(SCROW nFirstDataId, tools::Long nFirstIndex, const ScDPItemData &rSecondData, tools::Long nSecondIndex) const
std::vector< OUString > maMeasureNames
tools::Long GetColStartMeasure() const
std::vector< css::sheet::DataPilotFieldOrientation > maMeasureRefOrients
bool IsInGroup(SCROW nGroupDataId, tools::Long nGroupIndex, const ScDPItemData &rBaseData, tools::Long nBaseIndex) const
const ScDPSource & GetSource() const
bool IsBaseForGroup(tools::Long nDim) const
ResultMembers & GetDimResultMembers(tools::Long nDim, const ScDPDimension *pDim, ScDPLevel *pLevel) const
tools::Long GetMemberCount() const
void FillVisibilityData(ScDPResultVisibilityData &rData) const
void InitWithMembers(LateInitParams &rParams, const ::std::vector< SCROW > &pItemData, size_t nPos, ScDPInitState &rInitState)
void SortMembers(ScDPResultMember *pRefMember)
void LateInitFrom(LateInitParams &rParams, const ::std::vector< SCROW > &pItemData, size_t nPos, ScDPInitState &rInitState)
bool IsValidEntry(const ::std::vector< SCROW > &aMembers) const
tools::Long GetSortMeasure() const
void DoAutoShow(ScDPResultMember *pRefMember)
bool IsSortAscending() const
void UpdateRunningTotals(const ScDPResultMember *pRefMember, tools::Long nMeasure, ScDPRunningTotalState &rRunning, ScDPRowTotals &rTotals) const
void UpdateDataResults(const ScDPResultMember *pRefMember, tools::Long nMeasure) const
ScDPDataMember * GetRowReferenceMember(const ScDPRelativePos *pMemberPos, const OUString *pName, const sal_Int32 *pRowIndexes, const sal_Int32 *pColIndexes) const
void Dump(int nIndent) const
std::map< SCROW, ScDPResultMember * > MemberHash
std::vector< std::unique_ptr< ScDPResultMember > > MemberArray
ScDPResultDimension * GetFirstChildDimension() const
ScDPResultMember * InsertMember(const ScDPParentDimData *pMemberData)
const ScMemberSortOrder & GetMemberOrder() const
MemberArray maMemberArray
ScMemberSortOrder & GetMemberOrder()
ScDPResultMember * FindMember(SCROW iData) const
ScDPResultDimension(const ScDPResultData *pData)
void CheckShowEmpty(bool bShow=false)
void DumpState(const ScDPResultMember *pRefMember, ScDocument *pDoc, ScAddress &rPos) const
bool IsDataLayout() const
bool IsAutoTopItems() const
void FillMemberResults(css::uno::Sequence< css::sheet::MemberResult > *pSequences, tools::Long nStart, tools::Long nMeasure)
Test.
tools::Long GetAutoCount() const
tools::Long nSortMeasure
or ptr to IntDimension?
ScDPResultMember * AddMember(const ScDPParentDimData &aData)
tools::Long GetAutoMeasure() const
bool bSortByData
or ptr to IntDimension?
static ScDPDataMember * GetColReferenceMember(const ScDPRelativePos *pMemberPos, const OUString *pName, sal_Int32 nRefDimPos, const ScDPRunningTotalState &rRunning)
tools::Long GetSortedIndex(tools::Long nUnsorted) const
void ProcessData(const ::std::vector< SCROW > &aMembers, const ScDPResultDimension *pDataDim, const ::std::vector< SCROW > &aDataMembers, const ::std::vector< ScDPValue > &aValues) const
const ScDPResultMember * GetMember(tools::Long n) const
const ScDPResultData * pResultData
tools::Long GetSize(tools::Long nMeasure) const
void InitFrom(const ::std::vector< ScDPDimension * > &ppDim, const ::std::vector< ScDPLevel * > &ppLev, size_t nPos, ScDPInitState &rInitState, bool bInitChild=true)
bool IsSortByData() const
const OUString & GetName() const
void FillDataResults(const ScDPResultMember *pRefMember, ScDPResultFilterContext &rFilterCxt, css::uno::Sequence< css::uno::Sequence< css::sheet::DataResult > > &rSequence, tools::Long nMeasure) const
ScMemberSortOrder aMemberOrder
void ProcessData(const ::std::vector< SCROW > &aChildMembers, const ScDPResultDimension *pDataDim, const ::std::vector< SCROW > &aDataMembers, const ::std::vector< ScDPValue > &aValues)
void LateInitFrom(LateInitParams &rParams, const ::std::vector< SCROW > &pItemData, size_t nPos, ScDPInitState &rInitState)
const ScDPMember * GetDPMember() const
Ref.
SCROW GetOrder() const
Ref.
const ScDPLevel * GetParentLevel() const
Ref.
std::unique_ptr< ScDPResultDimension > pChildDimension
void UpdateDataResults(const ScDPResultMember *pRefMember, tools::Long nMeasure) const
ScDPResultMember(const ScDPResultData *pData, const ScDPParentDimData &rParentDimData)
const ScDPResultData * pResultData
void FillDataResults(const ScDPResultMember *pRefMember, ScDPResultFilterContext &rFilterCxt, css::uno::Sequence< css::uno::Sequence< css::sheet::DataResult > > &rSequence, tools::Long nMeasure) const
void InitFrom(const ::std::vector< ScDPDimension * > &ppDim, const ::std::vector< ScDPLevel * > &ppLev, size_t nPos, ScDPInitState &rInitState, bool bInitChild=true)
bool HasHiddenDetails() const
tools::Long GetSubTotalCount(tools::Long *pUserSubStart=nullptr) const
void CheckShowEmpty(bool bShow=false)
const ScDPDimension * GetParentDim() const
void Dump(int nIndent) const
void DoAutoShow(ScDPResultMember *pRefMember)
bool IsNamedItem(SCROW nIndex) const
ScDPResultDimension * GetChildDimension()
const ScDPResultDimension * GetChildDimension() const
this will be removed!
void FillVisibilityData(ScDPResultVisibilityData &rData) const
bool IsSubTotalInTitle(tools::Long nMeasure) const
OUString GetDisplayName(bool bLocaleIndependent) const
ScDPItemData FillItemData() const
void FillMemberResults(css::uno::Sequence< css::sheet::MemberResult > *pSequences, tools::Long &rPos, tools::Long nMeasure, bool bRoot, const OUString *pMemberName, const OUString *pMemberCaption)
ScDPParentDimData aParentDimData
ScDPDataMember * GetDataRoot() const
void UpdateRunningTotals(const ScDPResultMember *pRefMember, tools::Long nMeasure, ScDPRunningTotalState &rRunning, ScDPRowTotals &rTotals) const
tools::Long GetSize(tools::Long nMeasure) const
ScDPAggData * GetColTotal(tools::Long nMeasure) const
void SortMembers(ScDPResultMember *pRefMember)
std::unique_ptr< ScDPDataMember > pDataRoot
void DumpState(const ScDPResultMember *pRefMember, ScDocument *pDoc, ScAddress &rPos) const
bool IsValidEntry(const ::std::vector< SCROW > &aMembers) const
This class collects visible members of each dimension and uses that information to create filtering c...
~ScDPResultVisibilityData()
ScDPResultVisibilityData(ScDPSource *pSource)
void fillFieldFilters(::std::vector< ScDPFilteredCache::Criterion > &rFilters) const
void addVisibleMember(const OUString &rDimName, const ScDPItemData &rMemberItem)
std::unordered_map< OUString, VisibleMemberType > DimMemberType
DimMemberType maDimensions
std::unordered_set< ScDPItemData, MemberHash > VisibleMemberType
ScDPAggData * GetGrandTotal(tools::Long nMeasure)
void SetInColRoot(bool bSet)
ScDPAggData * GetRowTotal(tools::Long nMeasure)
indexes when calculating running totals
ScDPRunningTotalState(ScDPResultMember *pColRoot, ScDPResultMember *pRowRoot)
array of sal_Int32 terminated by -1.
void AddRowIndex(sal_Int32 nVisible, tools::Long nSorted)
std::vector< sal_Int32 > IndexArray
ScDPResultMember * GetRowResRoot() const
const IndexArray & GetRowVisible() const
ScDPResultMember * pColResRoot
const IndexArray & GetRowSorted() const
const IndexArray & GetColVisible() const
ScDPResultMember * pRowResRoot
void AddColIndex(sal_Int32 nVisible, tools::Long nSorted)
const IndexArray & GetColSorted() const
ScDPResultMember * GetColResRoot() const
Implements the Welford Online one-pass algorithm.
::std::vector< sal_Int32 > ScMemberSortOrder
const sal_Int64 SC_DPAGG_RESULT_VALID
const sal_Int64 SC_DPAGG_RESULT_EMPTY
const sal_Int64 SC_DPAGG_RESULT_ERROR
const sal_Int64 SC_DPAGG_EMPTY
separate header file?
const sal_Int64 SC_DPAGG_DATA_ERROR
Member(tools::Long nSrcIndex, SCROW nNameIndex)
const ScDPLevel * mpParentLevel
Ref.
const ScDPDimension * mpParentDim
Ref.
const ScDPMember * mpMemberDesc
Ref.
ScDPRelativePos(tools::Long nBase, tools::Long nDir)
size_t operator()(const ScDPItemData &r) const
Select subtotal information, passed down the dimensions.
tools::Long nColSubTotalFunc
tools::Long nRowSubTotalFunc