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