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

 ScDPSaveData (const ScDPSaveData &r)
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 (std::u16string_view rName)
SC_DLLPUBLIC ScDPSaveDimensionDuplicateDimension (const ScDPSaveDimension &rDim)
SC_DLLPUBLIC ScDPSaveDimensionGetExistingDimensionByName (std::u16string_view 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 tools::Long GetDataDimensionCount () const
void SetPosition (ScDPSaveDimension *pDim, tools::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 (std::u16string_view 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

Definition at line 235 of file dpsave.hxx.

Constructor & Destructor Documentation

ScDPSaveData::ScDPSaveData ( )

Definition at line 690 of file dpsave.cxx.

ScDPSaveData::ScDPSaveData ( const ScDPSaveData r)

Definition at line 701 of file dpsave.cxx.

References m_DimList, and pDimensionData.

ScDPSaveData::~ScDPSaveData ( )

Definition at line 761 of file dpsave.cxx.

Referenced by operator=().

Member Function Documentation

void ScDPSaveData::AddDimension ( ScDPSaveDimension pDim)

Definition at line 823 of file dpsave.cxx.

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

Referenced by DuplicateDimension().

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

Append a new original dimension.

Not to be called to insert a duplicate dimension.

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.
pointer to the new dimension just inserted.

Definition at line 1350 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)
void ScDPSaveData::DimensionsChanged ( )

Definition at line 1365 of file dpsave.cxx.

References mpDimOrder.

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

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

Definition at line 911 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.

rDims(out) list of dimensions for specified orientation

Definition at line 807 of file dpsave.cxx.

References ScDPSaveDimension::GetOrientation(), and m_DimList.

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

bool ScDPSaveData::GetColumnGrand ( ) const
tools::Long ScDPSaveData::GetDataDimensionCount ( ) const

Definition at line 942 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.

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

Definition at line 834 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
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 792 of file dpsave.cxx.

References GetAllDimensionsByOrientation(), and mpDimOrder.

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

Definition at line 875 of file dpsave.cxx.

References m_DimList.

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

ScDPSaveDimension * ScDPSaveData::GetExistingDimensionByName ( std::u16string_view  rName) const
const ScDPDimensionSaveData* ScDPSaveData::GetExistingDimensionData ( ) const
bool ScDPSaveData::GetFilterButton ( ) const
ScDPSaveDimension * ScDPSaveData::GetFirstDimension ( css::sheet::DataPilotFieldOrientation  eOrientation)

Definition at line 932 of file dpsave.cxx.

References m_DimList.

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

Definition at line 918 of file dpsave.cxx.

References m_DimList.

Referenced by ScDBFunc::HasSelectionForDrillDown().

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

Check whether a dimension has one or more invisible members.

rDimNamedimension name

Definition at line 1295 of file dpsave.cxx.

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

Referenced by XclImpPivotTable::ApplyMergeFlags().

bool ScDPSaveData::IsEmpty ( ) const

Definition at line 1148 of file dpsave.cxx.

References m_DimList.

Referenced by ScDBFunc::MakePivotTable().

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

Definition at line 720 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)
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,
tools::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

Definition at line 249 of file dpsave.hxx.

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

bool ScDPSaveData::bFilterButton

Definition at line 248 of file dpsave.hxx.

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

DimsType ScDPSaveData::m_DimList
DupNameCountType ScDPSaveData::maDupNameCounts

Definition at line 242 of file dpsave.hxx.

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

bool ScDPSaveData::mbDimensionMembersBuilt

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

Definition at line 256 of file dpsave.hxx.

Referenced by DimensionsChanged(), and GetDimensionSortOrder().

std::optional<OUString> ScDPSaveData::mpGrandTotalName

Definition at line 255 of file dpsave.hxx.

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

sal_uInt16 ScDPSaveData::nColumnGrandMode

Definition at line 244 of file dpsave.hxx.

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

sal_uInt16 ScDPSaveData::nIgnoreEmptyMode

Definition at line 246 of file dpsave.hxx.

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

sal_uInt16 ScDPSaveData::nRepeatEmptyMode

Definition at line 247 of file dpsave.hxx.

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

sal_uInt16 ScDPSaveData::nRowGrandMode

Definition at line 245 of file dpsave.hxx.

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

std::unique_ptr<ScDPDimensionSaveData> ScDPSaveData::pDimensionData

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: