LibreOffice Module sc (master)  1
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
oox::xls::PivotCacheField Class Reference

#include <pivotcachebuffer.hxx>

Inheritance diagram for oox::xls::PivotCacheField:
[legend]
Collaboration diagram for oox::xls::PivotCacheField:
[legend]

Public Member Functions

 PivotCacheField (const WorkbookHelper &rHelper, bool bIsDatabaseField)
 
void importCacheField (const AttributeList &rAttribs)
 Imports pivot cache field settings from the cacheField element. More...
 
void importSharedItems (const AttributeList &rAttribs)
 Imports shared items settings from the sharedItems element. More...
 
void importSharedItem (sal_Int32 nElement, const AttributeList &rAttribs)
 Imports a shared item from the passed element. More...
 
void importFieldGroup (const AttributeList &rAttribs)
 Imports grouping settings from the fieldGroup element. More...
 
void importRangePr (const AttributeList &rAttribs)
 Imports numeric grouping settings from the rangePr element. More...
 
void importDiscretePrItem (sal_Int32 nElement, const AttributeList &rAttribs)
 Imports an item of the mapping between group items and base items from the passed element. More...
 
void importGroupItem (sal_Int32 nElement, const AttributeList &rAttribs)
 Imports a group item from the passed element. More...
 
void importPCDField (SequenceInputStream &rStrm)
 Imports pivot cache field settings from the PCDFIELD record. More...
 
void importPCDFSharedItems (SequenceInputStream &rStrm)
 Imports shared items settings from the PCDFSHAREDITEMS record. More...
 
void importPCDFSharedItem (sal_Int32 nRecId, SequenceInputStream &rStrm)
 Imports one or more shared items from the passed record. More...
 
void importPCDFieldGroup (SequenceInputStream &rStrm)
 Imports grouping settings from the PCDFIELDGROUP record. More...
 
void importPCDFRangePr (SequenceInputStream &rStrm)
 Imports numeric grouping settings from the PCDFRANGEPR record. More...
 
void importPCDFDiscretePrItem (sal_Int32 nRecId, SequenceInputStream &rStrm)
 Imports an item of the mapping between group items and base items from the passed record. More...
 
void importPCDFGroupItem (sal_Int32 nRecId, SequenceInputStream &rStrm)
 Imports one or more group items from the passed record. More...
 
void applyItemCaptions (const IdCaptionPairList &vCaptions)
 Apply user Captions to imported group data. More...
 
bool isDatabaseField () const
 Returns true, if the field is based on source data, or false if it is grouped or calculated. More...
 
bool hasSharedItems () const
 Returns true, if the field contains a list of shared items. More...
 
bool hasGroupItems () const
 Returns true, if the field contains a list of grouping items. More...
 
bool hasNumericGrouping () const
 Returns true, if the field has inplace numeric grouping settings. More...
 
bool hasDateGrouping () const
 Returns true, if the field has inplace date grouping settings. More...
 
bool hasParentGrouping () const
 Returns true, if the field has a parent group field that groups the items of this field. More...
 
const OUString & getName () const
 Returns the name of the cache field. More...
 
sal_Int32 getParentGroupField () const
 Returns the index of the parent group field that groups the items of this field. More...
 
sal_Int32 getGroupBaseField () const
 Returns the index of the base field grouping is based on. More...
 
const OUString & getFinalGroupName () const
 Returns the finalized group name of this field. More...
 
void setFinalGroupName (const OUString &rFinalGroupName)
 Set the finalized group name of this field. More...
 
const PivotCacheItemgetCacheItem (sal_Int32 nItemIdx) const
 Returns the shared or group item with the specified index. More...
 
void getCacheItemNames (::std::vector< OUString > &orItemNames) const
 Returns the names of all shared or group items. More...
 
const PivotCacheItemListgetCacheItems () const
 Returns shared or group items. More...
 
void convertNumericGrouping (const css::uno::Reference< css::sheet::XDataPilotField > &rxDPField) const
 Creates inplace numeric grouping settings. More...
 
OUString createDateGroupField (const css::uno::Reference< css::sheet::XDataPilotField > &rxBaseDPField) const
 Creates inplace date grouping settings or a new date group field. More...
 
OUString createParentGroupField (const css::uno::Reference< css::sheet::XDataPilotField > &rxBaseDPField, const PivotCacheField &rBaseCacheField, PivotCacheGroupItemVector &orItemNames) const
 Creates a new grouped DataPilot field and returns its name. More...
 
void writeSourceHeaderCell (const WorksheetHelper &rSheetHelper, sal_Int32 nCol, sal_Int32 nRow) const
 Writes the title of the field into the passed sheet at the passed address. More...
 
void writeSourceDataCell (const WorksheetHelper &rSheetHelper, sal_Int32 nCol, sal_Int32 nRow, const PivotCacheItem &rItem) const
 Writes a source field item value into the passed sheet. More...
 
void importPCRecordItem (SequenceInputStream &rStrm, const WorksheetHelper &rSheetHelper, sal_Int32 nCol, sal_Int32 nRow) const
 Reads an item from the PCRECORD record and writes it to the passed sheet. More...
 
- Public Member Functions inherited from oox::xls::WorkbookHelper
 WorkbookHelper (WorkbookGlobals &rBookGlob)
 
virtual ~WorkbookHelper ()
 
 WorkbookHelper (WorkbookHelper const &)=default
 
 WorkbookHelper (WorkbookHelper &&)=default
 
WorkbookHelperoperator= (WorkbookHelper const &)=delete
 
WorkbookHelperoperator= (WorkbookHelper &&)=delete
 
::oox::core::FilterBasegetBaseFilter () const
 Returns the base filter object (base class of all filters). More...
 
SegmentProgressBargetProgressBar () const
 Returns the filter progress bar. More...
 
sal_Int16 getCurrentSheetIndex () const
 Returns the index of the current Calc sheet, if filter currently processes a sheet. More...
 
bool isGeneratorKnownGood () const
 Returns true when reading a file generated by a known good generator. More...
 
void setVbaProjectStorage (const StorageRef &rxVbaPrjStrg)
 Sets the VBA project storage used to import VBA source code and forms. More...
 
void setCurrentSheetIndex (SCTAB nSheet)
 Sets the index of the current Calc sheet, if filter currently processes a sheet. More...
 
void finalizeWorkbookImport ()
 Final conversion after importing the workbook. More...
 
void useInternalChartDataTable (bool bInternal)
 
ScDocumentgetScDocument ()
 
const ScDocumentgetScDocument () const
 
ScDocumentImportgetDocImport ()
 
const ScDocumentImportgetDocImport () const
 
ScEditEngineDefaultergetEditEngine () const
 
const css::uno::Reference< css::sheet::XSpreadsheetDocument > & getDocument () const
 Returns a reference to the source/target spreadsheet document model. More...
 
css::uno::Reference< css::sheet::XSpreadsheet > getSheetFromDoc (sal_Int32 nSheet) const
 Returns a reference to the specified spreadsheet in the document model. More...
 
css::uno::Reference< css::sheet::XSpreadsheet > getSheetFromDoc (const OUString &rSheet) const
 Returns a reference to the specified spreadsheet in the document model. More...
 
css::uno::Reference< css::table::XCellRange > getCellRangeFromDoc (const ScRange &rRange) const
 Returns the XCellRange interface for the passed cell range address. More...
 
css::uno::Reference< css::container::XNameContainer > getCellStyleFamily () const
 Returns the cell styles container from the Calc document. More...
 
css::uno::Reference< css::style::XStyle > getStyleObject (const OUString &rStyleName, bool bPageStyle) const
 Returns the specified cell or page style from the Calc document. More...
 
ScRangeDatacreateNamedRangeObject (OUString &orName, const css::uno::Sequence< css::sheet::FormulaToken > &rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags) const
 Creates and returns a defined name on-the-fly in the Calc document. More...
 
ScRangeDatacreateLocalNamedRangeObject (OUString &orName, const css::uno::Sequence< css::sheet::FormulaToken > &rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab) const
 Creates and returns a defined name on-the-fly in the sheet. More...
 
css::uno::Reference< css::sheet::XDatabaseRange > createDatabaseRangeObject (OUString &orName, const ScRange &rRangeAddr) const
 Creates and returns a database range on-the-fly in the Calc document. More...
 
css::uno::Reference< css::sheet::XDatabaseRange > createUnnamedDatabaseRangeObject (const ScRange &rRangeAddr) const
 Creates and returns an unnamed database range on-the-fly in the Calc document. More...
 
ScDBDatafindDatabaseRangeByIndex (sal_uInt16 nIndex) const
 Finds the (already existing) database range of the given formula token index. More...
 
css::uno::Reference< css::style::XStyle > createStyleObject (OUString &orStyleName, bool bPageStyle) const
 Creates and returns a com.sun.star.style.Style object for cells or pages. More...
 
FormulaBuffergetFormulaBuffer () const
 
WorkbookSettingsgetWorkbookSettings () const
 Returns the global workbook settings object. More...
 
ViewSettingsgetViewSettings () const
 Returns the workbook and sheet view settings object. More...
 
WorksheetBuffergetWorksheets () const
 Returns the worksheet buffer containing sheet names and properties. More...
 
ThemeBuffergetTheme () const
 Returns the office theme object read from the theme substorage. More...
 
StylesBuffergetStyles () const
 Returns all cell formatting objects read from the styles substream. More...
 
SharedStringsBuffergetSharedStrings () const
 Returns the shared strings read from the shared strings substream. More...
 
ExternalLinkBuffergetExternalLinks () const
 Returns the external links read from the external links substream. More...
 
DefinedNamesBuffergetDefinedNames () const
 Returns the defined names read from the workbook globals. More...
 
TableBuffergetTables () const
 Returns the tables collection (equivalent to Calc's database ranges). More...
 
ScenarioBuffergetScenarios () const
 Returns the scenarios collection. More...
 
ConnectionsBuffergetConnections () const
 Returns the collection of external data connections. More...
 
PivotCacheBuffergetPivotCaches () const
 Returns the collection of pivot caches. More...
 
PivotTableBuffergetPivotTables () const
 Returns the collection of pivot tables. More...
 
FormulaParsergetFormulaParser () const
 Returns a shared import formula parser (import filter only!). More...
 
FormulaParsercreateFormulaParser () const
 Returns an unshared import formula parser (import filter only!). More...
 
UnitConvertergetUnitConverter () const
 Returns the measurement unit converter. More...
 
AddressConvertergetAddressConverter () const
 Returns the converter for string to cell address/range conversion. More...
 
oox::drawingml::chart::ChartConvertergetChartConverter () const
 Returns the chart object converter. More...
 
PageSettingsConvertergetPageSettingsConverter () const
 Returns the page and print settings converter. More...
 
::oox::core::XmlFilterBasegetOoxFilter () const
 Returns the base OOXML/BIFF12 filter object. More...
 
bool importOoxFragment (const rtl::Reference< oox::core::FragmentHandler > &rxHandler)
 Imports a fragment using the passed fragment handler, which contains the full path to the fragment stream. More...
 
bool importOoxFragment (const rtl::Reference< oox::core::FragmentHandler > &rxHandler, oox::core::FastParser &rParser)
 
rtl_TextEncoding getTextEncoding () const
 Returns the text encoding used to import/export byte strings. More...
 

Private Types

typedef ::std::vector< sal_Int32 > IndexVector
 

Private Member Functions

void writeSharedItemToSourceDataCell (const WorksheetHelper &rSheetHelper, sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nItemIdx) const
 Tries to write the value of a shared item to the passed sheet position. More...
 

Static Private Member Functions

static void writeItemToSourceDataCell (const WorksheetHelper &rSheetHelper, sal_Int32 nCol, sal_Int32 nRow, const PivotCacheItem &rItem)
 Tries to write the passed value to the passed sheet position. More...
 

Private Attributes

PivotCacheItemList maSharedItems
 
PivotCacheItemList maGroupItems
 All shared items of this field. More...
 
IndexVector maDiscreteItems
 All group items of this field. More...
 
PCFieldModel maFieldModel
 Mapping between group and base items. More...
 
PCSharedItemsModel maSharedItemsModel
 Settings for this cache field. More...
 
PCFieldGroupModel maFieldGroupModel
 Settings for shared items. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from oox::xls::WorkbookHelper
static WorkbookGlobalsRef constructGlobals (ExcelFilter &rFilter)
 

Detailed Description

Definition at line 200 of file pivotcachebuffer.hxx.

Member Typedef Documentation

typedef ::std::vector< sal_Int32 > oox::xls::PivotCacheField::IndexVector
private

Definition at line 303 of file pivotcachebuffer.hxx.

Constructor & Destructor Documentation

oox::xls::PivotCacheField::PivotCacheField ( const WorkbookHelper rHelper,
bool  bIsDatabaseField 
)
explicit

Definition at line 396 of file pivotcachebuffer.cxx.

References maFieldModel, and oox::xls::PCFieldModel::mbDatabaseField.

Member Function Documentation

void oox::xls::PivotCacheField::applyItemCaptions ( const IdCaptionPairList vCaptions)
void oox::xls::PivotCacheField::convertNumericGrouping ( const css::uno::Reference< css::sheet::XDataPilotField > &  rxDPField) const
OUString oox::xls::PivotCacheField::createDateGroupField ( const css::uno::Reference< css::sheet::XDataPilotField > &  rxBaseDPField) const
OUString oox::xls::PivotCacheField::createParentGroupField ( const css::uno::Reference< css::sheet::XDataPilotField > &  rxBaseDPField,
const PivotCacheField rBaseCacheField,
PivotCacheGroupItemVector orItemNames 
) const
const PivotCacheItem * oox::xls::PivotCacheField::getCacheItem ( sal_Int32  nItemIdx) const

Returns the shared or group item with the specified index.

Definition at line 558 of file pivotcachebuffer.cxx.

References oox::xls::PivotCacheItemList::getCacheItem(), hasGroupItems(), hasSharedItems(), maGroupItems, and maSharedItems.

Referenced by oox::xls::PivotTableField::convertDataField().

void oox::xls::PivotCacheField::getCacheItemNames ( ::std::vector< OUString > &  orItemNames) const

Returns the names of all shared or group items.

Definition at line 575 of file pivotcachebuffer.cxx.

References oox::xls::PivotCacheItemList::getCacheItemNames(), hasGroupItems(), hasSharedItems(), maGroupItems, and maSharedItems.

const PivotCacheItemList & oox::xls::PivotCacheField::getCacheItems ( ) const

Returns shared or group items.

Definition at line 583 of file pivotcachebuffer.cxx.

References hasGroupItems(), maGroupItems, and maSharedItems.

Referenced by createParentGroupField().

const OUString& oox::xls::PivotCacheField::getFinalGroupName ( ) const
inline

Returns the finalized group name of this field.

Definition at line 259 of file pivotcachebuffer.hxx.

References maFieldGroupModel, and oox::xls::PCFieldGroupModel::msFinalGroupName.

sal_Int32 oox::xls::PivotCacheField::getGroupBaseField ( ) const
inline

Returns the index of the base field grouping is based on.

Definition at line 257 of file pivotcachebuffer.hxx.

References maFieldGroupModel, and oox::xls::PCFieldGroupModel::mnBaseField.

const OUString& oox::xls::PivotCacheField::getName ( ) const
inline

Returns the name of the cache field.

Definition at line 253 of file pivotcachebuffer.hxx.

References maFieldModel, and oox::xls::PCFieldModel::maName.

Referenced by oox::xls::PivotTableField::convertDataField(), and oox::xls::PivotTableField::convertRowColPageField().

sal_Int32 oox::xls::PivotCacheField::getParentGroupField ( ) const
inline

Returns the index of the parent group field that groups the items of this field.

Definition at line 255 of file pivotcachebuffer.hxx.

References maFieldGroupModel, and oox::xls::PCFieldGroupModel::mnParentField.

Referenced by oox::xls::PivotTable::finalizeParentGroupingImport().

bool oox::xls::PivotCacheField::hasDateGrouping ( ) const
inline

Returns true, if the field has inplace date grouping settings.

Definition at line 248 of file pivotcachebuffer.hxx.

References maFieldGroupModel, oox::xls::PCFieldGroupModel::mbDateGroup, and oox::xls::PCFieldGroupModel::mbRangeGroup.

Referenced by createDateGroupField().

bool oox::xls::PivotCacheField::hasGroupItems ( ) const
inline

Returns true, if the field contains a list of grouping items.

Definition at line 244 of file pivotcachebuffer.hxx.

References oox::xls::PivotCacheItemList::empty(), and maGroupItems.

Referenced by applyItemCaptions(), convertNumericGrouping(), createDateGroupField(), createParentGroupField(), getCacheItem(), getCacheItemNames(), and getCacheItems().

bool oox::xls::PivotCacheField::hasNumericGrouping ( ) const
inline

Returns true, if the field has inplace numeric grouping settings.

Definition at line 246 of file pivotcachebuffer.hxx.

References maFieldGroupModel, oox::xls::PCFieldGroupModel::mbDateGroup, and oox::xls::PCFieldGroupModel::mbRangeGroup.

Referenced by convertNumericGrouping().

bool oox::xls::PivotCacheField::hasParentGrouping ( ) const
inline

Returns true, if the field has a parent group field that groups the items of this field.

Definition at line 250 of file pivotcachebuffer.hxx.

References maFieldGroupModel, and oox::xls::PCFieldGroupModel::mnParentField.

bool oox::xls::PivotCacheField::hasSharedItems ( ) const
inline

Returns true, if the field contains a list of shared items.

Definition at line 242 of file pivotcachebuffer.hxx.

References oox::xls::PivotCacheItemList::empty(), and maSharedItems.

Referenced by applyItemCaptions(), getCacheItem(), getCacheItemNames(), and importPCRecordItem().

void oox::xls::PivotCacheField::importCacheField ( const AttributeList rAttribs)
void oox::xls::PivotCacheField::importDiscretePrItem ( sal_Int32  nElement,
const AttributeList rAttribs 
)

Imports an item of the mapping between group items and base items from the passed element.

Definition at line 460 of file pivotcachebuffer.cxx.

References oox::AttributeList::getInteger(), maDiscreteItems, and x.

Referenced by oox::xls::PivotCacheFieldContext::onCreateContext().

void oox::xls::PivotCacheField::importFieldGroup ( const AttributeList rAttribs)
void oox::xls::PivotCacheField::importGroupItem ( sal_Int32  nElement,
const AttributeList rAttribs 
)

Imports a group item from the passed element.

Definition at line 467 of file pivotcachebuffer.cxx.

References oox::xls::PivotCacheItemList::importItem(), and maGroupItems.

Referenced by oox::xls::PivotCacheFieldContext::onCreateContext().

void oox::xls::PivotCacheField::importPCDFDiscretePrItem ( sal_Int32  nRecId,
SequenceInputStream rStrm 
)

Imports an item of the mapping between group items and base items from the passed record.

Definition at line 546 of file pivotcachebuffer.cxx.

References oox::xls::BIFF12_ID_PCITEM_INDEX, maDiscreteItems, and oox::BinaryInputStream::readInt32().

Referenced by oox::xls::PivotCacheFieldContext::onCreateRecordContext().

void oox::xls::PivotCacheField::importPCDFGroupItem ( sal_Int32  nRecId,
SequenceInputStream rStrm 
)

Imports one or more group items from the passed record.

Definition at line 553 of file pivotcachebuffer.cxx.

References oox::xls::PivotCacheItemList::importItem(), and maGroupItems.

Referenced by oox::xls::PivotCacheFieldContext::onCreateRecordContext().

void oox::xls::PivotCacheField::importPCDField ( SequenceInputStream rStrm)
void oox::xls::PivotCacheField::importPCDFieldGroup ( SequenceInputStream rStrm)
void oox::xls::PivotCacheField::importPCDFRangePr ( SequenceInputStream rStrm)
void oox::xls::PivotCacheField::importPCDFSharedItem ( sal_Int32  nRecId,
SequenceInputStream rStrm 
)

Imports one or more shared items from the passed record.

Definition at line 512 of file pivotcachebuffer.cxx.

References oox::xls::PivotCacheItemList::importItem(), and maSharedItems.

Referenced by oox::xls::PivotCacheFieldContext::onCreateRecordContext().

void oox::xls::PivotCacheField::importPCDFSharedItems ( SequenceInputStream rStrm)
void oox::xls::PivotCacheField::importPCRecordItem ( SequenceInputStream rStrm,
const WorksheetHelper rSheetHelper,
sal_Int32  nCol,
sal_Int32  nRow 
) const
void oox::xls::PivotCacheField::importRangePr ( const AttributeList rAttribs)
void oox::xls::PivotCacheField::importSharedItem ( sal_Int32  nElement,
const AttributeList rAttribs 
)

Imports a shared item from the passed element.

Definition at line 435 of file pivotcachebuffer.cxx.

References oox::xls::PivotCacheItemList::importItem(), and maSharedItems.

Referenced by oox::xls::PivotCacheFieldContext::onCreateContext().

void oox::xls::PivotCacheField::importSharedItems ( const AttributeList rAttribs)
bool oox::xls::PivotCacheField::isDatabaseField ( ) const
inline

Returns true, if the field is based on source data, or false if it is grouped or calculated.

Definition at line 239 of file pivotcachebuffer.hxx.

References maFieldModel, and oox::xls::PCFieldModel::mbDatabaseField.

void oox::xls::PivotCacheField::setFinalGroupName ( const OUString &  rFinalGroupName)
inline

Set the finalized group name of this field.

Definition at line 261 of file pivotcachebuffer.hxx.

References maFieldGroupModel, and oox::xls::PCFieldGroupModel::msFinalGroupName.

Referenced by oox::xls::PivotTableField::finalizeParentGroupingImport().

void oox::xls::PivotCacheField::writeItemToSourceDataCell ( const WorksheetHelper rSheetHelper,
sal_Int32  nCol,
sal_Int32  nRow,
const PivotCacheItem rItem 
)
staticprivate
void oox::xls::PivotCacheField::writeSharedItemToSourceDataCell ( const WorksheetHelper rSheetHelper,
sal_Int32  nCol,
sal_Int32  nRow,
sal_Int32  nItemIdx 
) const
private

Tries to write the value of a shared item to the passed sheet position.

Definition at line 837 of file pivotcachebuffer.cxx.

References oox::xls::PivotCacheItemList::getCacheItem(), maSharedItems, and writeItemToSourceDataCell().

Referenced by importPCRecordItem(), and writeSourceDataCell().

void oox::xls::PivotCacheField::writeSourceDataCell ( const WorksheetHelper rSheetHelper,
sal_Int32  nCol,
sal_Int32  nRow,
const PivotCacheItem rItem 
) const
void oox::xls::PivotCacheField::writeSourceHeaderCell ( const WorksheetHelper rSheetHelper,
sal_Int32  nCol,
sal_Int32  nRow 
) const

Member Data Documentation

IndexVector oox::xls::PivotCacheField::maDiscreteItems
private

All group items of this field.

Definition at line 307 of file pivotcachebuffer.hxx.

Referenced by createParentGroupField(), importDiscretePrItem(), and importPCDFDiscretePrItem().

PCFieldGroupModel oox::xls::PivotCacheField::maFieldGroupModel
private
PCFieldModel oox::xls::PivotCacheField::maFieldModel
private

Mapping between group and base items.

Definition at line 308 of file pivotcachebuffer.hxx.

Referenced by getName(), importCacheField(), importPCDField(), isDatabaseField(), PivotCacheField(), and writeSourceHeaderCell().

PivotCacheItemList oox::xls::PivotCacheField::maGroupItems
private
PivotCacheItemList oox::xls::PivotCacheField::maSharedItems
private
PCSharedItemsModel oox::xls::PivotCacheField::maSharedItemsModel
private

Settings for this cache field.

Definition at line 309 of file pivotcachebuffer.hxx.

Referenced by importPCDFSharedItems(), importPCRecordItem(), and importSharedItems().


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