diff options
Diffstat (limited to 'sc/source/filter/oox/pivotcachefragment.cxx')
-rw-r--r-- | sc/source/filter/oox/pivotcachefragment.cxx | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/sc/source/filter/oox/pivotcachefragment.cxx b/sc/source/filter/oox/pivotcachefragment.cxx index 4f4498d10ed4..5a3a78488ea1 100644 --- a/sc/source/filter/oox/pivotcachefragment.cxx +++ b/sc/source/filter/oox/pivotcachefragment.cxx @@ -323,80 +323,6 @@ void PivotCacheRecordsFragment::importPCRecordItem( sal_Int32 nRecId, SequenceIn } } -BiffPivotCacheRecordsContext::BiffPivotCacheRecordsContext( const WorksheetHelper& rHelper, const PivotCache& rPivotCache ) : - BiffWorksheetContextBase( rHelper ), - mrPivotCache( rPivotCache ), - mnColIdx( 0 ), - mnRowIdx( 0 ), - mbHasShared( false ), - mbInRow( false ) -{ - // prepare sheet: insert column header names into top row - mrPivotCache.writeSourceHeaderCells( *this ); - - // find all fields without shared items, remember column indexes in source data - for( sal_Int32 nFieldIdx = 0, nFieldCount = mrPivotCache.getCacheFieldCount(), nCol = 0; nFieldIdx < nFieldCount; ++nFieldIdx ) - { - const PivotCacheField* pCacheField = mrPivotCache.getCacheField( nFieldIdx ); - if( pCacheField && pCacheField->isDatabaseField() ) - { - if( pCacheField->hasSharedItems() ) - mbHasShared = true; - else - maUnsharedCols.push_back( nCol ); - ++nCol; - } - } -} - -void BiffPivotCacheRecordsContext::importRecord( BiffInputStream& rStrm ) -{ - if( rStrm.getRecId() == BIFF_ID_PCITEM_INDEXLIST ) - { - OSL_ENSURE( mbHasShared, "BiffPivotCacheRecordsContext::importRecord - unexpected PCITEM_INDEXLIST record" ); - // PCITEM_INDEXLIST record always in front of a new data row - startNextRow(); - mrPivotCache.importPCItemIndexList( rStrm, *this, mnRowIdx ); - mbInRow = !maUnsharedCols.empty(); // mbInRow remains true, if unshared items are expected - return; - } - - PivotCacheItem aItem; - switch( rStrm.getRecId() ) - { - case BIFF_ID_PCITEM_MISSING: break; - case BIFF_ID_PCITEM_STRING: aItem.readString( rStrm, *this ); break; - case BIFF_ID_PCITEM_DOUBLE: aItem.readDouble( rStrm ); break; - case BIFF_ID_PCITEM_INTEGER: aItem.readInteger( rStrm ); break; - case BIFF_ID_PCITEM_DATE: aItem.readDate( rStrm ); break; - case BIFF_ID_PCITEM_BOOL: aItem.readBool( rStrm ); break; - case BIFF_ID_PCITEM_ERROR: aItem.readError( rStrm ); break; - default: return; // unknown record, ignore - } - - // find next column index, might start new row if no fields with shared items exist - if( mbInRow && (mnColIdx == maUnsharedCols.size()) ) - { - OSL_ENSURE( !mbHasShared, "BiffPivotCacheRecordsContext::importRecord - PCITEM_INDEXLIST record missing" ); - mbInRow = mbHasShared; // do not leave current row if PCITEM_INDEXLIST is expected - } - // start next row on first call, or on row wrap without shared items - if( !mbInRow ) - startNextRow(); - - // write the item data to the sheet cell - OSL_ENSURE( mnColIdx < maUnsharedCols.size(), "BiffPivotCacheRecordsContext::importRecord - invalid column index" ); - if( mnColIdx < maUnsharedCols.size() ) - mrPivotCache.writeSourceDataCell( *this, maUnsharedCols[ mnColIdx ], mnRowIdx, aItem ); - ++mnColIdx; -} - -void BiffPivotCacheRecordsContext::startNextRow() -{ - mnColIdx = 0; - ++mnRowIdx; - mbInRow = true; -} } // namespace xls } // namespace oox |