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

#include <pivotcachebuffer.hxx>

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

Public Member Functions

 PivotCache (const WorkbookHelper &rHelper)
 
void importPivotCacheDefinition (const AttributeList &rAttribs)
 Reads pivot cache global settings from the pivotCacheDefinition element. More...
 
void importCacheSource (const AttributeList &rAttribs)
 Reads cache source settings from the cacheSource element. More...
 
void importWorksheetSource (const AttributeList &rAttribs, const ::oox::core::Relations &rRelations)
 Reads sheet source settings from the worksheetSource element. More...
 
void importPCDefinition (SequenceInputStream &rStrm)
 Reads pivot cache global settings from the PCDEFINITION record. More...
 
void importPCDSource (SequenceInputStream &rStrm)
 Reads cache source settings from the PCDSOURCE record. More...
 
void importPCDSheetSource (SequenceInputStream &rStrm, const ::oox::core::Relations &rRelations)
 Reads sheet source settings from the PCDSHEETSOURCE record. More...
 
PivotCacheFieldcreateCacheField ()
 Creates and returns a new pivot cache field. More...
 
void finalizeImport ()
 Checks validity of source data and creates a dummy data sheet for external sheet sources. More...
 
bool isValidDataSource () const
 Returns true, if the pivot cache is based on a valid data source, so that pivot tables can be created based on this pivot cache. More...
 
bool isBasedOnDummySheet () const
 Returns true, if the pivot cache is based on a dummy sheet created in finalizeImport. More...
 
const ScRangegetSourceRange () const
 Returns the internal cell range the cache is based on. More...
 
const OUString & getRecordsRelId () const
 Returns the relation identifier of the pivot cache records fragment. More...
 
PivotCacheFieldgetCacheField (sal_Int32 nFieldIdx)
 Returns the cache field with the specified index. More...
 
const PivotCacheFieldgetCacheField (sal_Int32 nFieldIdx) const
 
sal_Int32 getCacheDatabaseIndex (sal_Int32 nFieldIdx) const
 Returns the source column index of the field with the passed index. More...
 
void writeSourceHeaderCells (const WorksheetHelper &rSheetHelper) const
 Writes the titles of all source fields into the passed sheet. More...
 
void writeSourceDataCell (const WorksheetHelper &rSheetHelper, sal_Int32 nColIdx, sal_Int32 nRowIdx, const PivotCacheItem &rItem) const
 Writes a source field item value into the passed sheet. More...
 
void importPCRecord (SequenceInputStream &rStrm, const WorksheetHelper &rSheetHelper, sal_Int32 nRowIdx) const
 Reads a PCRECORD record and writes all item values 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 RefVector< PivotCacheFieldPivotCacheFieldVector
 
typedef ::std::vector< sal_Int32 > IndexVector
 

Private Member Functions

void finalizeInternalSheetSource ()
 Finalizes the pivot cache if it is based on internal sheet data. More...
 
void finalizeExternalSheetSource ()
 Finalizes the pivot cache if it is based on sheet data of an external spreadsheet document. More...
 
void prepareSourceDataSheet ()
 Creates a dummy sheet that will be filled with the pivot cache data. More...
 
void updateSourceDataRow (const WorksheetHelper &rSheetHelper, sal_Int32 nRow) const
 Checks, if the row index has changed since last call, and initializes the sheet data buffer. More...
 

Private Attributes

PivotCacheFieldVector maFields
 
PivotCacheFieldVector maDatabaseFields
 All pivot cache fields. More...
 
IndexVector maDatabaseIndexes
 All cache fields that are based on source data. More...
 
PCDefinitionModel maDefModel
 Database field index for all fields. More...
 
PCSourceModel maSourceModel
 Global pivot cache settings. More...
 
PCWorksheetSourceModel maSheetSrcModel
 Pivot cache source settings. More...
 
ValueRangeSet maColSpans
 Sheet source data if cache type is sheet. More...
 
OUString maTargetUrl
 Column spans used by SheetDataBuffer for optimized cell import. More...
 
sal_Int32 mnCurrRow
 URL of an external source document. More...
 
bool mbValidSource
 Current row index in dummy sheet. More...
 
bool mbDummySheet
 True = pivot cache is based on supported data source. More...
 

Additional Inherited Members

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

Detailed Description

Definition at line 353 of file pivotcachebuffer.hxx.

Member Typedef Documentation

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

Definition at line 418 of file pivotcachebuffer.hxx.

Definition at line 417 of file pivotcachebuffer.hxx.

Constructor & Destructor Documentation

oox::xls::PivotCache::PivotCache ( const WorkbookHelper rHelper)
explicit

Definition at line 872 of file pivotcachebuffer.cxx.

Member Function Documentation

PivotCacheField & oox::xls::PivotCache::createCacheField ( )

Creates and returns a new pivot cache field.

Definition at line 982 of file pivotcachebuffer.cxx.

References maFields.

Referenced by oox::xls::PivotCacheDefinitionFragment::onCreateContext(), and oox::xls::PivotCacheDefinitionFragment::onCreateRecordContext().

void oox::xls::PivotCache::finalizeExternalSheetSource ( )
private

Finalizes the pivot cache if it is based on sheet data of an external spreadsheet document.

Definition at line 1140 of file pivotcachebuffer.cxx.

References maDefModel, oox::xls::PCWorksheetSourceModel::maDefName, oox::xls::PCDefinitionModel::maRelId, oox::xls::PCWorksheetSourceModel::maSheet, maSheetSrcModel, and prepareSourceDataSheet().

Referenced by finalizeImport().

void oox::xls::PivotCache::finalizeImport ( )
void oox::xls::PivotCache::finalizeInternalSheetSource ( )
private
sal_Int32 oox::xls::PivotCache::getCacheDatabaseIndex ( sal_Int32  nFieldIdx) const

Returns the source column index of the field with the passed index.

Definition at line 1045 of file pivotcachebuffer.cxx.

References oox::ContainerHelper::getVectorElement(), and maDatabaseIndexes.

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

PivotCacheField * oox::xls::PivotCache::getCacheField ( sal_Int32  nFieldIdx)

Returns the cache field with the specified index.

Definition at line 1035 of file pivotcachebuffer.cxx.

References oox::RefVector< ObjType >::get(), and maFields.

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

const PivotCacheField * oox::xls::PivotCache::getCacheField ( sal_Int32  nFieldIdx) const

Definition at line 1040 of file pivotcachebuffer.cxx.

References oox::RefVector< ObjType >::get(), and maFields.

const OUString& oox::xls::PivotCache::getRecordsRelId ( ) const
inline

Returns the relation identifier of the pivot cache records fragment.

Definition at line 386 of file pivotcachebuffer.hxx.

References maDefModel, and oox::xls::PCDefinitionModel::maRelId.

Referenced by oox::xls::PivotCacheDefinitionFragment::finalizeImport().

const ScRange& oox::xls::PivotCache::getSourceRange ( ) const
inline

Returns the internal cell range the cache is based on.

Definition at line 384 of file pivotcachebuffer.hxx.

References oox::xls::PCWorksheetSourceModel::maRange, and maSheetSrcModel.

Referenced by oox::xls::PivotCacheDefinitionFragment::finalizeImport(), and oox::xls::PivotTable::finalizeImport().

void oox::xls::PivotCache::importCacheSource ( const AttributeList rAttribs)
void oox::xls::PivotCache::importPCDefinition ( SequenceInputStream rStrm)
void oox::xls::PivotCache::importPCDSheetSource ( SequenceInputStream rStrm,
const ::oox::core::Relations rRelations 
)
void oox::xls::PivotCache::importPCDSource ( SequenceInputStream rStrm)
void oox::xls::PivotCache::importPCRecord ( SequenceInputStream rStrm,
const WorksheetHelper rSheetHelper,
sal_Int32  nRowIdx 
) const
void oox::xls::PivotCache::importPivotCacheDefinition ( const AttributeList rAttribs)
void oox::xls::PivotCache::importWorksheetSource ( const AttributeList rAttribs,
const ::oox::core::Relations rRelations 
)
bool oox::xls::PivotCache::isBasedOnDummySheet ( ) const
inline

Returns true, if the pivot cache is based on a dummy sheet created in finalizeImport.

Definition at line 381 of file pivotcachebuffer.hxx.

References mbDummySheet.

Referenced by oox::xls::PivotCacheDefinitionFragment::finalizeImport().

bool oox::xls::PivotCache::isValidDataSource ( ) const
inline

Returns true, if the pivot cache is based on a valid data source, so that pivot tables can be created based on this pivot cache.

Definition at line 379 of file pivotcachebuffer.hxx.

References mbValidSource.

Referenced by oox::xls::PivotCacheDefinitionFragment::finalizeImport(), and oox::xls::PivotTable::finalizeImport().

void oox::xls::PivotCache::prepareSourceDataSheet ( )
private
void oox::xls::PivotCache::updateSourceDataRow ( const WorksheetHelper rSheetHelper,
sal_Int32  nRow 
) const
private

Checks, if the row index has changed since last call, and initializes the sheet data buffer.

Definition at line 1168 of file pivotcachebuffer.cxx.

References oox::xls::WorksheetHelper::getSheetData(), maColSpans, mnCurrRow, and oox::xls::SheetDataBuffer::setColSpans().

Referenced by writeSourceDataCell(), and writeSourceHeaderCells().

void oox::xls::PivotCache::writeSourceDataCell ( const WorksheetHelper rSheetHelper,
sal_Int32  nColIdx,
sal_Int32  nRowIdx,
const PivotCacheItem rItem 
) const
void oox::xls::PivotCache::writeSourceHeaderCells ( const WorksheetHelper rSheetHelper) const

Member Data Documentation

ValueRangeSet oox::xls::PivotCache::maColSpans
private

Sheet source data if cache type is sheet.

Definition at line 426 of file pivotcachebuffer.hxx.

Referenced by prepareSourceDataSheet(), and updateSourceDataRow().

PivotCacheFieldVector oox::xls::PivotCache::maDatabaseFields
private

All pivot cache fields.

Definition at line 421 of file pivotcachebuffer.hxx.

Referenced by finalizeImport(), importPCRecord(), writeSourceDataCell(), and writeSourceHeaderCells().

IndexVector oox::xls::PivotCache::maDatabaseIndexes
private

All cache fields that are based on source data.

Definition at line 422 of file pivotcachebuffer.hxx.

Referenced by finalizeImport(), and getCacheDatabaseIndex().

PCDefinitionModel oox::xls::PivotCache::maDefModel
private

Database field index for all fields.

Definition at line 423 of file pivotcachebuffer.hxx.

Referenced by finalizeExternalSheetSource(), getRecordsRelId(), importPCDefinition(), and importPivotCacheDefinition().

PivotCacheFieldVector oox::xls::PivotCache::maFields
private

Definition at line 420 of file pivotcachebuffer.hxx.

Referenced by createCacheField(), finalizeImport(), and getCacheField().

PCWorksheetSourceModel oox::xls::PivotCache::maSheetSrcModel
private
PCSourceModel oox::xls::PivotCache::maSourceModel
private

Global pivot cache settings.

Definition at line 424 of file pivotcachebuffer.hxx.

Referenced by finalizeImport(), importCacheSource(), and importPCDSource().

OUString oox::xls::PivotCache::maTargetUrl
private

Column spans used by SheetDataBuffer for optimized cell import.

Definition at line 427 of file pivotcachebuffer.hxx.

Referenced by finalizeImport(), importPCDSheetSource(), and importWorksheetSource().

bool oox::xls::PivotCache::mbDummySheet
private

True = pivot cache is based on supported data source.

Definition at line 430 of file pivotcachebuffer.hxx.

Referenced by isBasedOnDummySheet(), and prepareSourceDataSheet().

bool oox::xls::PivotCache::mbValidSource
private

Current row index in dummy sheet.

Definition at line 429 of file pivotcachebuffer.hxx.

Referenced by finalizeInternalSheetSource(), isValidDataSource(), and prepareSourceDataSheet().

sal_Int32 oox::xls::PivotCache::mnCurrRow
mutableprivate

URL of an external source document.

Definition at line 428 of file pivotcachebuffer.hxx.

Referenced by updateSourceDataRow(), and writeSourceHeaderCells().


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