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 (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
 
SC_DLLPUBLIC void SetExpandCollapse (bool bSet)
 
bool GetExpandCollapse () 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 bExpandCollapse
 
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

◆ DimOrderType

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

Definition at line 237 of file dpsave.hxx.

◆ DimsType

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

Definition at line 238 of file dpsave.hxx.

◆ DupNameCountType

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

Definition at line 235 of file dpsave.hxx.

Constructor & Destructor Documentation

◆ ScDPSaveData() [1/2]

ScDPSaveData::ScDPSaveData ( )

Definition at line 692 of file dpsave.cxx.

◆ ScDPSaveData() [2/2]

ScDPSaveData::ScDPSaveData ( const ScDPSaveData r)

Definition at line 704 of file dpsave.cxx.

References m_DimList, and pDimensionData.

◆ ~ScDPSaveData()

ScDPSaveData::~ScDPSaveData ( )

Definition at line 765 of file dpsave.cxx.

Referenced by operator=().

Member Function Documentation

◆ AddDimension()

void ScDPSaveData::AddDimension ( ScDPSaveDimension pDim)

Definition at line 827 of file dpsave.cxx.

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

Referenced by DuplicateDimension().

◆ AppendNewDimension()

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 1371 of file dpsave.cxx.

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

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

◆ BuildAllDimensionMembers()

void ScDPSaveData::BuildAllDimensionMembers ( ScDPTableData pData)

Definition at line 1219 of file dpsave.cxx.

References aMap, i, m_DimList, mbDimensionMembersBuilt, and pData.

◆ CheckDuplicateName()

void ScDPSaveData::CheckDuplicateName ( ScDPSaveDimension rDim)
private

◆ DimensionsChanged()

void ScDPSaveData::DimensionsChanged ( )
private

Definition at line 1386 of file dpsave.cxx.

References mpDimOrder.

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

◆ Dump()

void ScDPSaveData::Dump ( ) const

◆ DuplicateDimension() [1/2]

ScDPSaveDimension & ScDPSaveData::DuplicateDimension ( const ScDPSaveDimension rDim)

Definition at line 915 of file dpsave.cxx.

References AddDimension().

◆ DuplicateDimension() [2/2]

ScDPSaveDimension * ScDPSaveData::DuplicateDimension ( std::u16string_view  rName)

◆ GetAllDimensionsByOrientation()

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 811 of file dpsave.cxx.

References ScDPSaveDimension::GetOrientation(), and m_DimList.

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

◆ GetColumnGrand()

bool ScDPSaveData::GetColumnGrand ( ) const
inline

◆ GetDataDimensionCount()

tools::Long ScDPSaveData::GetDataDimensionCount ( ) const

Definition at line 946 of file dpsave.cxx.

References m_DimList.

Referenced by XclExpXmlPivotTables::SavePivotTableXml().

◆ GetDataLayoutDimension()

ScDPSaveDimension * ScDPSaveData::GetDataLayoutDimension ( )

◆ GetDimensionByName()

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 838 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(), ScGridWindow::DPTestMouse(), ScDPObject::ToggleDetails(), and ScGridWindow::UpdateDPFromFieldPopupMenu().

◆ GetDimensionData()

ScDPDimensionSaveData * ScDPSaveData::GetDimensionData ( )

◆ GetDimensions()

const DimsType & ScDPSaveData::GetDimensions ( ) const
inline

◆ GetDimensionSortOrder()

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 796 of file dpsave.cxx.

References GetAllDimensionsByOrientation(), and mpDimOrder.

◆ GetDrillDown()

bool ScDPSaveData::GetDrillDown ( ) const
inline

◆ GetExistingDataLayoutDimension()

ScDPSaveDimension * ScDPSaveData::GetExistingDataLayoutDimension ( ) const

Definition at line 879 of file dpsave.cxx.

References m_DimList.

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

◆ GetExistingDimensionByName()

ScDPSaveDimension * ScDPSaveData::GetExistingDimensionByName ( std::u16string_view  rName) const

◆ GetExistingDimensionData()

const ScDPDimensionSaveData * ScDPSaveData::GetExistingDimensionData ( ) const
inline

◆ GetExpandCollapse()

bool ScDPSaveData::GetExpandCollapse ( ) const
inline

◆ GetFilterButton()

bool ScDPSaveData::GetFilterButton ( ) const
inline

◆ GetFirstDimension()

ScDPSaveDimension * ScDPSaveData::GetFirstDimension ( css::sheet::DataPilotFieldOrientation  eOrientation)

Definition at line 936 of file dpsave.cxx.

References m_DimList.

◆ GetGrandTotalName()

const std::optional< OUString > & ScDPSaveData::GetGrandTotalName ( ) const

◆ GetIgnoreEmptyRows()

bool ScDPSaveData::GetIgnoreEmptyRows ( ) const
inline

◆ GetInnermostDimension()

ScDPSaveDimension * ScDPSaveData::GetInnermostDimension ( css::sheet::DataPilotFieldOrientation  nOrientation)

Definition at line 922 of file dpsave.cxx.

References m_DimList.

Referenced by ScDBFunc::HasSelectionForDrillDown().

◆ GetNewDimensionByName()

ScDPSaveDimension * ScDPSaveData::GetNewDimensionByName ( const OUString &  rName)

◆ GetRepeatIfEmpty()

bool ScDPSaveData::GetRepeatIfEmpty ( ) const
inline

◆ GetRowGrand()

bool ScDPSaveData::GetRowGrand ( ) const
inline

◆ HasInvisibleMember()

bool ScDPSaveData::HasInvisibleMember ( std::u16string_view  rDimName) const

Check whether a dimension has one or more invisible members.

Parameters
rDimNamedimension name

Definition at line 1316 of file dpsave.cxx.

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

Referenced by XclImpPivotTable::ApplyMergeFlags().

◆ IsEmpty()

bool ScDPSaveData::IsEmpty ( ) const

Definition at line 1157 of file dpsave.cxx.

References m_DimList.

Referenced by ScDBFunc::MakePivotTable().

◆ operator=()

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

Definition at line 724 of file dpsave.cxx.

References ~ScDPSaveData().

◆ operator==()

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

◆ RemoveAllGroupDimensions()

void ScDPSaveData::RemoveAllGroupDimensions ( const OUString &  rSrcDimName,
std::vector< OUString > *  pDeletedNames = nullptr 
)

◆ RemoveDimensionByName()

void ScDPSaveData::RemoveDimensionByName ( const OUString &  rName)

◆ RemoveDuplicateNameCount()

void ScDPSaveData::RemoveDuplicateNameCount ( const OUString &  rName)
private

◆ SetColumnGrand()

void ScDPSaveData::SetColumnGrand ( bool  bSet)

◆ SetDimensionData()

void ScDPSaveData::SetDimensionData ( const ScDPDimensionSaveData pNew)

◆ SetDrillDown()

void ScDPSaveData::SetDrillDown ( bool  bSet)

◆ SetExpandCollapse()

void ScDPSaveData::SetExpandCollapse ( bool  bSet)

Definition at line 1017 of file dpsave.cxx.

References bExpandCollapse.

Referenced by ScPivotLayoutDialog::ApplySaveData().

◆ SetFilterButton()

void ScDPSaveData::SetFilterButton ( bool  bSet)

◆ SetGrandTotalName()

void ScDPSaveData::SetGrandTotalName ( const OUString &  rName)

◆ SetIgnoreEmptyRows()

void ScDPSaveData::SetIgnoreEmptyRows ( bool  bSet)

◆ SetPosition()

void ScDPSaveData::SetPosition ( ScDPSaveDimension pDim,
tools::Long  nNew 
)

◆ SetRepeatIfEmpty()

void ScDPSaveData::SetRepeatIfEmpty ( bool  bSet)

◆ SetRowGrand()

void ScDPSaveData::SetRowGrand ( bool  bSet)

◆ SyncAllDimensionMembers()

void ScDPSaveData::SyncAllDimensionMembers ( ScDPTableData pData)

Definition at line 1265 of file dpsave.cxx.

References aMap, i, m_DimList, pData, and SAL_WARN.

◆ WriteToSource()

void ScDPSaveData::WriteToSource ( const css::uno::Reference< css::sheet::XDimensionsSupplier > &  xSource)

Member Data Documentation

◆ bDrillDown

bool ScDPSaveData::bDrillDown
private

Definition at line 249 of file dpsave.hxx.

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

◆ bExpandCollapse

bool ScDPSaveData::bExpandCollapse
private

Definition at line 250 of file dpsave.hxx.

Referenced by GetExpandCollapse(), and SetExpandCollapse().

◆ bFilterButton

bool ScDPSaveData::bFilterButton
private

Definition at line 248 of file dpsave.hxx.

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

◆ m_DimList

DimsType ScDPSaveData::m_DimList
private

◆ maDupNameCounts

DupNameCountType ScDPSaveData::maDupNameCounts
private

Definition at line 242 of file dpsave.hxx.

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

◆ mbDimensionMembersBuilt

bool ScDPSaveData::mbDimensionMembersBuilt
private

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

Definition at line 254 of file dpsave.hxx.

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

◆ mpDimOrder

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

Definition at line 257 of file dpsave.hxx.

Referenced by DimensionsChanged(), and GetDimensionSortOrder().

◆ mpGrandTotalName

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

Definition at line 256 of file dpsave.hxx.

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

◆ nColumnGrandMode

sal_uInt16 ScDPSaveData::nColumnGrandMode
private

Definition at line 244 of file dpsave.hxx.

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

◆ nIgnoreEmptyMode

sal_uInt16 ScDPSaveData::nIgnoreEmptyMode
private

Definition at line 246 of file dpsave.hxx.

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

◆ nRepeatEmptyMode

sal_uInt16 ScDPSaveData::nRepeatEmptyMode
private

Definition at line 247 of file dpsave.hxx.

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

◆ nRowGrandMode

sal_uInt16 ScDPSaveData::nRowGrandMode
private

Definition at line 245 of file dpsave.hxx.

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

◆ pDimensionData

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(), GetExistingDimensionData(), operator==(), RemoveAllGroupDimensions(), ScDPSaveData(), and SetDimensionData().


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