22#include <osl/diagnose.h>
23#include <oox/token/namespaces.hxx>
36 mrCacheField( rCacheField )
42 switch( getCurrentElement() )
44 case XLS_TOKEN( cacheField ):
49 case XLS_TOKEN( fieldGroup ):
53 case XLS_TOKEN( discretePr ):
return this;
54 case XLS_TOKEN( groupItems ):
return this;
73 switch( getCurrentElement() )
101 if( isRootElement() )
108 mrPivotCache( rPivotCache )
114 switch( getCurrentElement() )
120 case XLS_TOKEN( pivotCacheDefinition ):
124 case XLS_TOKEN( cacheFields ):
return this;
128 case XLS_TOKEN( cacheSource ):
132 case XLS_TOKEN( cacheFields ):
141 switch( getCurrentElement() )
168 static const RecordInfo spRecInfos[] =
195 if( !aRecFragmentPath.isEmpty() )
206 const OUString& rFragmentPath,
const PivotCache& rPivotCache ) :
208 mrPivotCache( rPivotCache ),
223 switch( getCurrentElement() )
226 if( nElement == XLS_TOKEN( pivotCacheRecords ) )
return this;
229 case XLS_TOKEN( pivotCacheRecords ):
238 case XLS_TOKEN(
m ):
break;
239 case XLS_TOKEN( s ): aItem.
readString( rAttribs );
break;
240 case XLS_TOKEN(
n ): aItem.
readNumeric( rAttribs );
break;
241 case XLS_TOKEN(
d ): aItem.
readDate( rAttribs );
break;
242 case XLS_TOKEN( b ): aItem.
readBool( rAttribs );
break;
243 case XLS_TOKEN( e ): aItem.
readError( rAttribs );
break;
244 case XLS_TOKEN(
x ): aItem.
readIndex( rAttribs );
break;
245 default: OSL_FAIL(
"OoxPivotCacheRecordsFragment::onCreateContext - unexpected element" );
257 switch( getCurrentElement() )
277 static const RecordInfo spRecInfos[] =
316 default: OSL_FAIL(
"OoxPivotCacheRecordsFragment::importPCRecordItem - unexpected record" );
PivotCacheDefinitionFragment(const WorkbookHelper &rHelper, const OUString &rFragmentPath, PivotCache &rPivotCache)
virtual void finalizeImport() override
virtual const ::oox::core::RecordInfo * getRecordInfos() const override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
PivotCache & mrPivotCache
virtual ::oox::core::ContextHandlerRef onCreateRecordContext(sal_Int32 nRecId, SequenceInputStream &rStrm) override
PivotCacheFieldContext(WorkbookFragmentBase &rFragment, PivotCacheField &rCacheField)
PivotCacheField & mrCacheField
virtual void onStartRecord(SequenceInputStream &rStrm) override
virtual void onStartElement(const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateRecordContext(sal_Int32 nRecId, SequenceInputStream &rStrm) override
void importPCDFSharedItem(sal_Int32 nRecId, SequenceInputStream &rStrm)
Imports one or more shared items from the passed record.
void importPCDFGroupItem(sal_Int32 nRecId, SequenceInputStream &rStrm)
Imports one or more group items from the passed record.
void importFieldGroup(const AttributeList &rAttribs)
Imports grouping settings from the fieldGroup element.
void importPCDFSharedItems(SequenceInputStream &rStrm)
Imports shared items settings from the PCDFSHAREDITEMS record.
void importGroupItem(sal_Int32 nElement, const AttributeList &rAttribs)
Imports a group item from the passed element.
void importCacheField(const AttributeList &rAttribs)
Imports pivot cache field settings from the cacheField element.
void importSharedItem(sal_Int32 nElement, const AttributeList &rAttribs)
Imports a shared item from the passed element.
void importDiscretePrItem(sal_Int32 nElement, const AttributeList &rAttribs)
Imports an item of the mapping between group items and base items from the passed element.
void importRangePr(const AttributeList &rAttribs)
Imports numeric grouping settings from the rangePr element.
void importPCDField(SequenceInputStream &rStrm)
Imports pivot cache field settings from the PCDFIELD record.
void importSharedItems(const AttributeList &rAttribs)
Imports shared items settings from the sharedItems element.
void importPCDFDiscretePrItem(sal_Int32 nRecId, SequenceInputStream &rStrm)
Imports an item of the mapping between group items and base items from the passed record.
void importPCDFRangePr(SequenceInputStream &rStrm)
Imports numeric grouping settings from the PCDFRANGEPR record.
void importPCDFieldGroup(SequenceInputStream &rStrm)
Imports grouping settings from the PCDFIELDGROUP record.
void readString(const AttributeList &rAttribs)
Reads the string value from a pivot cache item.
void readBool(const AttributeList &rAttribs)
Reads the boolean value from a pivot cache item.
void readIndex(const AttributeList &rAttribs)
Reads the index of a shared item.
void readDate(const AttributeList &rAttribs)
Reads the date/time value from a pivot cache item.
void readError(const AttributeList &rAttribs)
Reads the error code value from a pivot cache item.
void readNumeric(const AttributeList &rAttribs)
Reads the double value from a pivot cache item.
void readDouble(SequenceInputStream &rStrm)
Reads the double value from a pivot cache item.
const PivotCache & mrPivotCache
bool mbInRecord
Relative row index in source data.
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
PivotCacheRecordsFragment(const WorksheetHelper &rHelper, const OUString &rFragmentPath, const PivotCache &rPivotCache)
virtual const ::oox::core::RecordInfo * getRecordInfos() const override
void importPCRecord(SequenceInputStream &rStrm)
sal_Int32 mnRowIdx
Relative column index in source data.
void importPCRecordItem(sal_Int32 nRecId, SequenceInputStream &rStrm)
virtual ::oox::core::ContextHandlerRef onCreateRecordContext(sal_Int32 nRecId, SequenceInputStream &rStrm) override
void importPCDSheetSource(SequenceInputStream &rStrm, const ::oox::core::Relations &rRelations)
Reads sheet source settings from the PCDSHEETSOURCE record.
void importPivotCacheDefinition(const AttributeList &rAttribs)
Reads pivot cache global settings from the pivotCacheDefinition element.
void importPCRecord(SequenceInputStream &rStrm, const WorksheetHelper &rSheetHelper, sal_Int32 nRowIdx) const
Reads a PCRECORD record and writes all item values to the passed sheet.
void importPCDefinition(SequenceInputStream &rStrm)
Reads pivot cache global settings from the PCDEFINITION record.
bool isBasedOnDummySheet() const
Returns true, if the pivot cache is based on a dummy sheet created in finalizeImport.
void importCacheSource(const AttributeList &rAttribs)
Reads cache source settings from the cacheSource element.
const ScRange & getSourceRange() const
Returns the internal cell range the cache is based on.
bool isValidDataSource() const
Returns true, if the pivot cache is based on a valid data source, so that pivot tables can be created...
PivotCacheField & createCacheField()
Creates and returns a new pivot cache field.
void finalizeImport()
Checks validity of source data and creates a dummy data sheet for external sheet sources.
void importPCDSource(SequenceInputStream &rStrm)
Reads cache source settings from the PCDSOURCE record.
const OUString & getRecordsRelId() const
Returns the relation identifier of the pivot cache records fragment.
void importWorksheetSource(const AttributeList &rAttribs, const ::oox::core::Relations &rRelations)
Reads sheet source settings from the worksheetSource element.
void writeSourceHeaderCells(const WorksheetHelper &rSheetHelper) const
Writes the titles of all source fields into the passed sheet.
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.
Context handler derived from the WorkbookHelper helper class.
Fragment handler derived from the WorkbookHelper helper class.
Helper class to provide access to global workbook data.
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 st...
WorksheetBuffer & getWorksheets() const
Returns the worksheet buffer containing sheet names and properties.
FormulaBuffer & getFormulaBuffer() const
UnitConverter & getUnitConverter() const
Returns the measurement unit converter.
sal_Int32 getAllSheetCount() const
Returns the number of all sheets, workbook + dummy ones (pivot table cache records )
Fragment handler derived from the WorksheetHelper helper class.
static WorksheetGlobalsRef constructGlobals(const WorkbookHelper &rHelper, const ISegmentProgressBarRef &rxProgressBar, WorksheetType eSheetType, SCTAB nSheet)
const sal_Int32 XML_ROOT_CONTEXT
const sal_Int32 BIFF12_ID_PCITEM_ARRAY
const sal_Int32 BIFF12_ID_PCDFDISCRETEPR
const sal_Int32 BIFF12_ID_PCDSHEETSOURCE
const sal_Int32 BIFF12_ID_PCDFGROUPITEMS
const sal_Int32 BIFF12_ID_PCITEM_INDEX
const sal_Int32 BIFF12_ID_PCITEM_MISSING
const sal_Int32 BIFF12_ID_PCDSOURCE
const sal_Int32 BIFF12_ID_PCDFIELDS
const sal_Int32 BIFF12_ID_PCITEM_BOOL
const sal_Int32 BIFF12_ID_PCITEM_DATE
const sal_Int32 BIFF12_ID_PCRECORD
const sal_Int32 BIFF12_ID_PCITEM_DOUBLE
const sal_Int32 BIFF12_ID_PCDFSHAREDITEMS
const sal_Int32 BIFF12_ID_PCDFIELD
const sal_Int32 BIFF12_ID_PCITEM_ERROR
std::shared_ptr< WorksheetGlobals > WorksheetGlobalsRef
const sal_Int32 BIFF12_ID_PCRECORDS
const sal_Int32 BIFF12_ID_PCRECORDDT
const sal_Int32 BIFF12_ID_PCDFIELDGROUP
const sal_Int32 BIFF12_ID_PCDFRANGEPR
const sal_Int32 BIFF12_ID_PCITEM_STRING
const sal_Int32 BIFF12_ID_PCDEFINITION
std::shared_ptr< ISegmentProgressBar > ISegmentProgressBarRef