LibreOffice Module sc (master)  1
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ScDPSaveData Class Reference

#include <dpsave.hxx>

Public Types

typedef std::unordered_map< OUString, size_t > DimOrderType
 
typedef std::vector< std::unique_ptr< ScDPSaveDimension > > DimsType
 

Public Member Functions

SC_DLLPUBLIC ScDPSaveData ()
 
 ScDPSaveData (const ScDPSaveData &r)
 
SC_DLLPUBLIC ~ScDPSaveData ()
 
ScDPSaveDataoperator= (const ScDPSaveData &r)
 
bool operator== (const ScDPSaveData &r) const
 
SC_DLLPUBLIC void SetGrandTotalName (const OUString &rName)
 
SC_DLLPUBLIC const std::optional< OUString > & GetGrandTotalName () const
 
const DimsTypeGetDimensions () const
 
const DimOrderTypeGetDimensionSortOrder () const
 Get sort order map to sort row and column dimensions in order of appearance. More...
 
SC_DLLPUBLIC void GetAllDimensionsByOrientation (css::sheet::DataPilotFieldOrientation eOrientation, std::vector< const ScDPSaveDimension * > &rDims) const
 Get all dimensions in a given orientation. More...
 
void AddDimension (ScDPSaveDimension *pDim)
 
SC_DLLPUBLIC ScDPSaveDimensionGetDimensionByName (const OUString &rName)
 Get a dimension object by its name. More...
 
SC_DLLPUBLIC ScDPSaveDimensionGetDataLayoutDimension ()
 
SC_DLLPUBLIC ScDPSaveDimensionGetExistingDataLayoutDimension () const
 
ScDPSaveDimensionDuplicateDimension (const OUString &rName)
 
SC_DLLPUBLIC ScDPSaveDimensionDuplicateDimension (const ScDPSaveDimension &rDim)
 
SC_DLLPUBLIC ScDPSaveDimensionGetExistingDimensionByName (const OUString &rName) const
 
SC_DLLPUBLIC ScDPSaveDimensionGetNewDimensionByName (const OUString &rName)
 
void RemoveDimensionByName (const OUString &rName)
 
ScDPSaveDimensionGetInnermostDimension (css::sheet::DataPilotFieldOrientation nOrientation)
 
ScDPSaveDimensionGetFirstDimension (css::sheet::DataPilotFieldOrientation eOrientation)
 
SC_DLLPUBLIC long GetDataDimensionCount () const
 
void SetPosition (ScDPSaveDimension *pDim, long nNew)
 
SC_DLLPUBLIC void SetColumnGrand (bool bSet)
 
bool GetColumnGrand () const
 
SC_DLLPUBLIC void SetRowGrand (bool bSet)
 
bool GetRowGrand () const
 
SC_DLLPUBLIC void SetIgnoreEmptyRows (bool bSet)
 
bool GetIgnoreEmptyRows () const
 
SC_DLLPUBLIC void SetRepeatIfEmpty (bool bSet)
 
bool GetRepeatIfEmpty () const
 
SC_DLLPUBLIC void SetFilterButton (bool bSet)
 
bool GetFilterButton () const
 
SC_DLLPUBLIC void SetDrillDown (bool bSet)
 
bool GetDrillDown () const
 
void WriteToSource (const css::uno::Reference< css::sheet::XDimensionsSupplier > &xSource)
 
bool IsEmpty () const
 
const ScDPDimensionSaveDataGetExistingDimensionData () const
 
void RemoveAllGroupDimensions (const OUString &rSrcDimName, std::vector< OUString > *pDeletedNames=nullptr)
 
SC_DLLPUBLIC ScDPDimensionSaveDataGetDimensionData ()
 
SC_DLLPUBLIC void SetDimensionData (const ScDPDimensionSaveData *pNew)
 
void BuildAllDimensionMembers (ScDPTableData *pData)
 
void SyncAllDimensionMembers (ScDPTableData *pData)
 
SC_DLLPUBLIC bool HasInvisibleMember (const OUString &rDimName) const
 Check whether a dimension has one or more invisible members. More...
 
void Dump () const
 

Private Types

typedef std::unordered_map< OUString, size_t > DupNameCountType
 

Private Member Functions

void CheckDuplicateName (ScDPSaveDimension &rDim)
 
void RemoveDuplicateNameCount (const OUString &rName)
 
ScDPSaveDimensionAppendNewDimension (const OUString &rName, bool bDataLayout)
 Append a new original dimension. More...
 
void DimensionsChanged ()
 

Private Attributes

DimsType m_DimList
 
DupNameCountType maDupNameCounts
 
std::unique_ptr< ScDPDimensionSaveDatapDimensionData
 keep track of number of duplicates in each name. More...
 
sal_uInt16 nColumnGrandMode
 
sal_uInt16 nRowGrandMode
 
sal_uInt16 nIgnoreEmptyMode
 
sal_uInt16 nRepeatEmptyMode
 
bool bFilterButton
 
bool bDrillDown
 
bool mbDimensionMembersBuilt
 if true, all dimensions already have all of their member instances created. More...
 
std::optional< OUString > mpGrandTotalName
 
std::unique_ptr< DimOrderTypempDimOrder
 

Detailed Description

Definition at line 233 of file dpsave.hxx.

Member Typedef Documentation

typedef std::unordered_map<OUString, size_t> ScDPSaveData::DimOrderType

Definition at line 237 of file dpsave.hxx.

typedef std::vector<std::unique_ptr<ScDPSaveDimension> > ScDPSaveData::DimsType

Definition at line 238 of file dpsave.hxx.

typedef std::unordered_map<OUString, size_t> ScDPSaveData::DupNameCountType
private

Definition at line 235 of file dpsave.hxx.

Constructor & Destructor Documentation

ScDPSaveData::ScDPSaveData ( )

Definition at line 691 of file dpsave.cxx.

ScDPSaveData::ScDPSaveData ( const ScDPSaveData r)

Definition at line 702 of file dpsave.cxx.

References m_DimList, and pDimensionData.

ScDPSaveData::~ScDPSaveData ( )

Definition at line 762 of file dpsave.cxx.

Referenced by operator=().

Member Function Documentation

void ScDPSaveData::AddDimension ( ScDPSaveDimension pDim)

Definition at line 824 of file dpsave.cxx.

References CheckDuplicateName(), DimensionsChanged(), and m_DimList.

Referenced by DuplicateDimension().

ScDPSaveDimension * ScDPSaveData::AppendNewDimension ( const OUString &  rName,
bool  bDataLayout 
)
private

Append a new original dimension.

Not to be called to insert a duplicate dimension.

Parameters
rNameDimension name. The name must be the original dimension name; not a duplicate dimension name.
bDataLayouttrue if this is a data layout dimension, false otherwise.
Returns
pointer to the new dimension just inserted.

Definition at line 1351 of file dpsave.cxx.

References DimensionsChanged(), ScDPUtil::isDuplicateDimension(), and maDupNameCounts.

Referenced by GetDataLayoutDimension(), GetDimensionByName(), and GetNewDimensionByName().

void ScDPSaveData::BuildAllDimensionMembers ( ScDPTableData pData)
void ScDPSaveData::CheckDuplicateName ( ScDPSaveDimension rDim)
private
void ScDPSaveData::DimensionsChanged ( )
private

Definition at line 1366 of file dpsave.cxx.

References mpDimOrder.

Referenced by AddDimension(), AppendNewDimension(), RemoveDimensionByName(), and SetPosition().

void ScDPSaveData::Dump ( ) const
ScDPSaveDimension * ScDPSaveData::DuplicateDimension ( const OUString &  rName)
ScDPSaveDimension & ScDPSaveData::DuplicateDimension ( const ScDPSaveDimension rDim)

Definition at line 912 of file dpsave.cxx.

References AddDimension().

void ScDPSaveData::GetAllDimensionsByOrientation ( css::sheet::DataPilotFieldOrientation  eOrientation,
std::vector< const ScDPSaveDimension * > &  rDims 
) const

Get all dimensions in a given orientation.

The order represents the actual order of occurrence. The returned list also includes data layout dimension.

Parameters
eOrientationorientation
rDims(out) list of dimensions for specified orientation

Definition at line 808 of file dpsave.cxx.

References ScDPSaveDimension::GetOrientation(), and m_DimList.

Referenced by XclImpPivotTable::ApplyMergeFlags(), and GetDimensionSortOrder().

bool ScDPSaveData::GetColumnGrand ( ) const
inline
long ScDPSaveData::GetDataDimensionCount ( ) const

Definition at line 943 of file dpsave.cxx.

References m_DimList.

Referenced by XclExpXmlPivotTables::SavePivotTableXml().

ScDPSaveDimension * ScDPSaveData::GetDataLayoutDimension ( )
ScDPSaveDimension * ScDPSaveData::GetDimensionByName ( const OUString &  rName)

Get a dimension object by its name.

If one doesn't exist for the given name, it creates a new one.

Parameters
rNamedimension name
Returns
pointer to the dimension object. The ScDPSaveData instance manages its life cycle; hence the caller must not delete this object.

Definition at line 835 of file dpsave.cxx.

References AppendNewDimension(), and m_DimList.

Referenced by ScDPObject::ConvertOrientation(), oox::xls::PivotTableField::convertPageField(), oox::xls::PivotTableField::convertRowColPageField(), ScDataPilotFieldObj::createDateGroup(), ScDataPilotFieldObj::createNameGroup(), ScDBFunc::DataPilotSort(), ScDPObject::ToggleDetails(), and ScGridWindow::UpdateDPFromFieldPopupMenu().

ScDPDimensionSaveData * ScDPSaveData::GetDimensionData ( )
const DimsType& ScDPSaveData::GetDimensions ( ) const
inline
const ScDPSaveData::DimOrderType & ScDPSaveData::GetDimensionSortOrder ( ) const

Get sort order map to sort row and column dimensions in order of appearance.

Row dimensions get sorted before column dimensions. This is used to traverse result tree, which is structured following this order.

Definition at line 793 of file dpsave.cxx.

References GetAllDimensionsByOrientation(), and mpDimOrder.

bool ScDPSaveData::GetDrillDown ( ) const
inline
ScDPSaveDimension * ScDPSaveData::GetExistingDataLayoutDimension ( ) const

Definition at line 876 of file dpsave.cxx.

References m_DimList.

Referenced by GetDataLayoutDimension(), and XclExpPivotTable::SetPropertiesFromDP().

ScDPSaveDimension * ScDPSaveData::GetExistingDimensionByName ( const OUString &  rName) const
const ScDPDimensionSaveData* ScDPSaveData::GetExistingDimensionData ( ) const
inline
bool ScDPSaveData::GetFilterButton ( ) const
inline
ScDPSaveDimension * ScDPSaveData::GetFirstDimension ( css::sheet::DataPilotFieldOrientation  eOrientation)

Definition at line 933 of file dpsave.cxx.

References m_DimList.

const std::optional< OUString > & ScDPSaveData::GetGrandTotalName ( ) const
bool ScDPSaveData::GetIgnoreEmptyRows ( ) const
inline
ScDPSaveDimension * ScDPSaveData::GetInnermostDimension ( css::sheet::DataPilotFieldOrientation  nOrientation)

Definition at line 919 of file dpsave.cxx.

References m_DimList.

Referenced by ScDBFunc::HasSelectionForDrillDown().

ScDPSaveDimension * ScDPSaveData::GetNewDimensionByName ( const OUString &  rName)
bool ScDPSaveData::GetRepeatIfEmpty ( ) const
inline
bool ScDPSaveData::GetRowGrand ( ) const
inline
bool ScDPSaveData::HasInvisibleMember ( const OUString &  rDimName) const

Check whether a dimension has one or more invisible members.

Parameters
rDimNamedimension name

Definition at line 1296 of file dpsave.cxx.

References GetExistingDimensionByName(), and ScDPSaveDimension::HasInvisibleMember().

Referenced by XclImpPivotTable::ApplyMergeFlags().

bool ScDPSaveData::IsEmpty ( ) const

Definition at line 1149 of file dpsave.cxx.

References m_DimList.

Referenced by ScDBFunc::MakePivotTable().

ScDPSaveData & ScDPSaveData::operator= ( const ScDPSaveData r)

Definition at line 721 of file dpsave.cxx.

References ~ScDPSaveData().

bool ScDPSaveData::operator== ( const ScDPSaveData r) const
void ScDPSaveData::RemoveAllGroupDimensions ( const OUString &  rSrcDimName,
std::vector< OUString > *  pDeletedNames = nullptr 
)
void ScDPSaveData::RemoveDimensionByName ( const OUString &  rName)
void ScDPSaveData::RemoveDuplicateNameCount ( const OUString &  rName)
private
void ScDPSaveData::SetColumnGrand ( bool  bSet)
void ScDPSaveData::SetDimensionData ( const ScDPDimensionSaveData pNew)
void ScDPSaveData::SetDrillDown ( bool  bSet)
void ScDPSaveData::SetFilterButton ( bool  bSet)
void ScDPSaveData::SetGrandTotalName ( const OUString &  rName)
void ScDPSaveData::SetIgnoreEmptyRows ( bool  bSet)
void ScDPSaveData::SetPosition ( ScDPSaveDimension pDim,
long  nNew 
)
void ScDPSaveData::SetRepeatIfEmpty ( bool  bSet)
void ScDPSaveData::SetRowGrand ( bool  bSet)
void ScDPSaveData::SyncAllDimensionMembers ( ScDPTableData pData)
void ScDPSaveData::WriteToSource ( const css::uno::Reference< css::sheet::XDimensionsSupplier > &  xSource)

Member Data Documentation

bool ScDPSaveData::bDrillDown
private

Definition at line 249 of file dpsave.hxx.

Referenced by GetDrillDown(), operator==(), and SetDrillDown().

bool ScDPSaveData::bFilterButton
private

Definition at line 248 of file dpsave.hxx.

Referenced by GetFilterButton(), operator==(), and SetFilterButton().

DimsType ScDPSaveData::m_DimList
private
DupNameCountType ScDPSaveData::maDupNameCounts
private

Definition at line 242 of file dpsave.hxx.

Referenced by AppendNewDimension(), CheckDuplicateName(), and RemoveDuplicateNameCount().

bool ScDPSaveData::mbDimensionMembersBuilt
private

if true, all dimensions already have all of their member instances created.

Definition at line 253 of file dpsave.hxx.

Referenced by BuildAllDimensionMembers(), and operator==().

std::unique_ptr<DimOrderType> ScDPSaveData::mpDimOrder
mutableprivate

Definition at line 256 of file dpsave.hxx.

Referenced by DimensionsChanged(), and GetDimensionSortOrder().

std::optional<OUString> ScDPSaveData::mpGrandTotalName
private

Definition at line 255 of file dpsave.hxx.

Referenced by GetGrandTotalName(), operator==(), and SetGrandTotalName().

sal_uInt16 ScDPSaveData::nColumnGrandMode
private

Definition at line 244 of file dpsave.hxx.

Referenced by operator==(), SetColumnGrand(), and WriteToSource().

sal_uInt16 ScDPSaveData::nIgnoreEmptyMode
private

Definition at line 246 of file dpsave.hxx.

Referenced by operator==(), SetIgnoreEmptyRows(), and WriteToSource().

sal_uInt16 ScDPSaveData::nRepeatEmptyMode
private

Definition at line 247 of file dpsave.hxx.

Referenced by operator==(), SetRepeatIfEmpty(), and WriteToSource().

sal_uInt16 ScDPSaveData::nRowGrandMode
private

Definition at line 245 of file dpsave.hxx.

Referenced by operator==(), SetRowGrand(), and WriteToSource().

std::unique_ptr<ScDPDimensionSaveData> ScDPSaveData::pDimensionData
private

keep track of number of duplicates in each name.

Definition at line 243 of file dpsave.hxx.

Referenced by GetDimensionData(), operator==(), RemoveAllGroupDimensions(), ScDPSaveData(), and SetDimensionData().


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