diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2012-04-13 23:11:31 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2012-04-13 23:11:31 +0200 |
commit | e00e693d2b3c39246328a99adc142284edbed285 (patch) | |
tree | 7bb7906f1fdc7ea6a9cf22c7fe4a1bacb6283b25 /sc/source | |
parent | bb5fa5773461e14de153266ccfa36e5f454ff9b8 (diff) |
Some cleaning sc (oox)
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/filter/inc/pivotcachebuffer.hxx | 4 | ||||
-rw-r--r-- | sc/source/filter/inc/pivottablebuffer.hxx | 15 | ||||
-rw-r--r-- | sc/source/filter/oox/pivotcachebuffer.cxx | 19 | ||||
-rw-r--r-- | sc/source/filter/oox/pivottablebuffer.cxx | 158 |
4 files changed, 0 insertions, 196 deletions
diff --git a/sc/source/filter/inc/pivotcachebuffer.hxx b/sc/source/filter/inc/pivotcachebuffer.hxx index cb57fef25e36..31be3e431587 100644 --- a/sc/source/filter/inc/pivotcachebuffer.hxx +++ b/sc/source/filter/inc/pivotcachebuffer.hxx @@ -455,10 +455,6 @@ public: WorksheetHelper& rSheetHelper, sal_Int32 nRowIdx ) const; private: - /** Reads the worksheet source range from the DCONREF record. */ - void importDConRef( BiffInputStream& rStrm ); - /** Reads the defined name used for source data from the DCONNAME record. */ - void importDConName( BiffInputStream& rStrm ); /** Reads the sheet name and URL from the DCONREF, DCONNAME, or DCONBINAME records. */ void importDConUrl( BiffInputStream& rStrm ); diff --git a/sc/source/filter/inc/pivottablebuffer.hxx b/sc/source/filter/inc/pivottablebuffer.hxx index 3be869169fea..a907b3f8e319 100644 --- a/sc/source/filter/inc/pivottablebuffer.hxx +++ b/sc/source/filter/inc/pivottablebuffer.hxx @@ -154,10 +154,6 @@ public: /** Imports pivot field item reference settings from the PTREFERENCEITEM record. */ void importPTReferenceItem( SequenceInputStream& rStrm ); - /** Imports pivot field settings from the PTFIELD and following records. */ - void importPTField( BiffInputStream& rStrm ); - /** Imports pivot field settings from the PTFIELD2 record. */ - void importPTField2( BiffInputStream& rStrm ); /** Imports settings of an item in this pivot field from the PTFITEM record. */ void importPTFItem( BiffInputStream& rStrm ); @@ -348,17 +344,6 @@ public: /** Reads the settings of a field located in the data dimension from the PTDATAFIELD record. */ void importPTDataField( SequenceInputStream& rStrm ); - /** Reads global pivot table settings from the PTDEFINITION record. */ - void importPTDefinition( BiffInputStream& rStrm, sal_Int16 nSheet ); - /** Reads additional global pivot table settings from the PTDEFINITION2 record. */ - void importPTDefinition2( BiffInputStream& rStrm ); - /** Reads the indexes of all fields located in the row or column dimension from a PTROWCOLFIELDS record. */ - void importPTRowColFields( BiffInputStream& rStrm ); - /** Reads the settings of all fields located in the page dimension from a PTPAGEFIELDS record. */ - void importPTPageFields( BiffInputStream& rStrm ); - /** Reads the settings of a field located in the data dimension from a PTDATAFIELD record. */ - void importPTDataField( BiffInputStream& rStrm ); - /** Creates and returns a new pivot table field. */ PivotTableField& createTableField(); /** Creates and returns a new pivot table filter. */ diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx b/sc/source/filter/oox/pivotcachebuffer.cxx index 2a07a615e6e0..395c2a81e11b 100644 --- a/sc/source/filter/oox/pivotcachebuffer.cxx +++ b/sc/source/filter/oox/pivotcachebuffer.cxx @@ -1330,25 +1330,6 @@ void PivotCache::importPCItemIndexList( BiffInputStream& rStrm, WorksheetHelper& // private -------------------------------------------------------------------- -void PivotCache::importDConRef( BiffInputStream& rStrm ) -{ - BinRange aBinRange; - aBinRange.read( rStrm, false ); // always 8-bit column indexes - // store range address unchecked with sheet index 0, will be resolved/checked later - getAddressConverter().convertToCellRangeUnchecked( maSheetSrcModel.maRange, aBinRange, 0 ); - - // the URL with (required) sheet name and optional URL of an external document - importDConUrl( rStrm ); - OSL_ENSURE( !maSheetSrcModel.maSheet.isEmpty(), "PivotCache::importDConRef - missing sheet name" ); -} - -void PivotCache::importDConName( BiffInputStream& rStrm ) -{ - maSheetSrcModel.maDefName = (getBiff() == BIFF8) ? rStrm.readUniString() : rStrm.readByteStringUC( false, getTextEncoding() ); - OSL_ENSURE( !maSheetSrcModel.maDefName.isEmpty(), "PivotCache::importDConName - missing defined name" ); - importDConUrl( rStrm ); -} - void PivotCache::importDConUrl( BiffInputStream& rStrm ) { // the URL with sheet name and optional URL of an external document diff --git a/sc/source/filter/oox/pivottablebuffer.cxx b/sc/source/filter/oox/pivottablebuffer.cxx index 0a5dc7388f81..c203cbfea336 100644 --- a/sc/source/filter/oox/pivottablebuffer.cxx +++ b/sc/source/filter/oox/pivottablebuffer.cxx @@ -443,64 +443,6 @@ void PivotTableField::importPTReferenceItem( SequenceInputStream& rStrm ) rStrm >> maModel.mnSortRefItem; } -void PivotTableField::importPTField( BiffInputStream& rStrm ) -{ - sal_uInt16 nAxis, nSubtCount, nSubtotals; - rStrm >> nAxis >> nSubtCount >> nSubtotals; - rStrm.skip( 2 ); // item count - - maModel.setBiffAxis( extractValue< sal_uInt8 >( nAxis, 0, 3 ) ); - maModel.mbDataField = getFlag( nAxis, BIFF_PTFIELD_DATAFIELD ); - - maModel.mbDefaultSubtotal = getFlag( nSubtotals, BIFF_PTFIELD_DEFAULT ); - maModel.mbSumSubtotal = getFlag( nSubtotals, BIFF_PTFIELD_SUM ); - maModel.mbCountASubtotal = getFlag( nSubtotals, BIFF_PTFIELD_COUNTA ); - maModel.mbAverageSubtotal = getFlag( nSubtotals, BIFF_PTFIELD_AVERAGE ); - maModel.mbMaxSubtotal = getFlag( nSubtotals, BIFF_PTFIELD_MAX ); - maModel.mbMinSubtotal = getFlag( nSubtotals, BIFF_PTFIELD_MIN ); - maModel.mbProductSubtotal = getFlag( nSubtotals, BIFF_PTFIELD_PRODUCT ); - maModel.mbCountSubtotal = getFlag( nSubtotals, BIFF_PTFIELD_COUNT ); - maModel.mbStdDevSubtotal = getFlag( nSubtotals, BIFF_PTFIELD_STDDEV ); - maModel.mbStdDevPSubtotal = getFlag( nSubtotals, BIFF_PTFIELD_STDDEVP ); - maModel.mbVarSubtotal = getFlag( nSubtotals, BIFF_PTFIELD_VAR ); - maModel.mbVarPSubtotal = getFlag( nSubtotals, BIFF_PTFIELD_VARP ); - - // set different defaults for BIFF - maModel.mbShowAll = maModel.mbOutline = maModel.mbSubtotalTop = false; - - // read following items - while( (rStrm.getNextRecId() == BIFF_ID_PTFITEM) && rStrm.startNextRecord() ) - importPTFItem( rStrm ); - - // read following PTFIELD2 record with additional field settings - if( (getBiff() == BIFF8) && (rStrm.getNextRecId() == BIFF_ID_PTFIELD2) && rStrm.startNextRecord() ) - importPTField2( rStrm ); -} - -void PivotTableField::importPTField2( BiffInputStream& rStrm ) -{ - sal_uInt32 nFlags; - rStrm >> nFlags; - maModel.mnSortRefItem = rStrm.readInt16(); - maModel.mnAutoShowRankBy = rStrm.readInt16(); - maModel.mnNumFmtId = rStrm.readuInt16(); - - maModel.mnAutoShowItems = extractValue< sal_Int32 >( nFlags, 24, 8 ); - maModel.mbShowAll = getFlag( nFlags, BIFF_PTFIELD2_SHOWALL ); - maModel.mbOutline = getFlag( nFlags, BIFF_PTFIELD2_OUTLINE ); - maModel.mbSubtotalTop = getFlag( nFlags, BIFF_PTFIELD2_SUBTOTALTOP ); - maModel.mbInsertBlankRow = getFlag( nFlags, BIFF_PTFIELD2_INSERTBLANKROW ); - maModel.mbAutoShow = getFlag( nFlags, BIFF_PTFIELD2_AUTOSHOW ); - maModel.mbTopAutoShow = getFlag( nFlags, BIFF_PTFIELD2_AUTOSHOWTOP ); - - bool bAutoSort = getFlag( nFlags, BIFF_PTFIELD2_AUTOSORT ); - bool bAscending = getFlag( nFlags, BIFF_PTFIELD2_SORTASCENDING ); - maModel.mnSortType = bAutoSort ? (bAscending ? XML_ascending : XML_descending) : XML_manual; - // mnSortRefField == OOX_PT_DATALAYOUTFIELD will indicate sorting by data field - if( maModel.mnSortRefItem >= 0 ) - maModel.mnSortRefField = OOX_PT_DATALAYOUTFIELD; -} - void PivotTableField::importPTFItem( BiffInputStream& rStrm ) { PTFieldItemModel aModel; @@ -1254,106 +1196,6 @@ void PivotTable::importPTDataField( SequenceInputStream& rStrm ) maDataFields.push_back( aModel ); } -void PivotTable::importPTDefinition( BiffInputStream& rStrm, sal_Int16 nSheet ) -{ - BinRange aBinRange; - sal_uInt16 nFlags, nTabNameLen, nDataNameLen; - rStrm >> aBinRange; - maLocationModel.mnFirstHeaderRow = rStrm.readuInt16(); - maLocationModel.mnFirstDataRow = rStrm.readuInt16(); - maLocationModel.mnFirstDataCol = rStrm.readuInt16(); - maDefModel.mnCacheId = rStrm.readuInt16(); - rStrm.skip( 2 ); // unused - maDefModel.mbDataOnRows = rStrm.readuInt16() == BIFF_PTDEF_ROWAXIS; - maDefModel.mnDataPosition = rStrm.readInt16(); - rStrm.skip( 2 ); // number of fields - rStrm >> maDefModel.mnRowFields >> maDefModel.mnColFields; - rStrm.skip( 8 ); // number of page fields, data fields, data rows, data columns - rStrm >> nFlags; - maDefModel.mnChartFormat = rStrm.readuInt16(); - rStrm >> nTabNameLen >> nDataNameLen; - maDefModel.maName = lclReadPivotString( *this, rStrm, nTabNameLen ); - maDefModel.maDataCaption = lclReadPivotString( *this, rStrm, nDataNameLen ); - - maDefModel.mbRowGrandTotals = getFlag( nFlags, BIFF_PTDEF_ROWGRANDTOTALS ); - maDefModel.mbColGrandTotals = getFlag( nFlags, BIFF_PTDEF_COLGRANDTOTALS ); - - getAddressConverter().convertToCellRangeUnchecked( maLocationModel.maRange, aBinRange, nSheet ); -} - -void PivotTable::importPTDefinition2( BiffInputStream& rStrm ) -{ - if( getBiff() == BIFF8 ) - { - sal_uInt16 nErrCaptLen, nMissCaptLen, nTagLen, nPageStyleLen, nTabStyleLen, nVacStyleLen; - sal_uInt32 nFlags; - rStrm.skip( 2 ); // number of formatting records - rStrm >> nErrCaptLen >> nMissCaptLen >> nTagLen; - rStrm.skip( 6 ); // number of selection records, page rows, page columns - rStrm >> nFlags >> nPageStyleLen >> nTabStyleLen >> nVacStyleLen; - maDefModel.maErrorCaption = lclReadPivotString( *this, rStrm, nErrCaptLen ); - maDefModel.maMissingCaption = lclReadPivotString( *this, rStrm, nMissCaptLen ); - maDefModel.maTag = lclReadPivotString( *this, rStrm, nTagLen ); - maDefModel.maPageStyle = lclReadPivotString( *this, rStrm, nPageStyleLen ); - maDefModel.maPivotTableStyle = lclReadPivotString( *this, rStrm, nTabStyleLen ); - maDefModel.maVacatedStyle = lclReadPivotString( *this, rStrm, nVacStyleLen ); - - maDefModel.mbShowError = getFlag( nFlags, BIFF_PTDEF2_SHOWERROR ); - maDefModel.mbShowMissing = getFlag( nFlags, BIFF_PTDEF2_SHOWMISSING ); - maDefModel.mbEnableDrill = getFlag( nFlags, BIFF_PTDE2F_ENABLEDRILL ); - maDefModel.mbPreserveFormatting = getFlag( nFlags, BIFF_PTDEF2_PRESERVEFORMATTING ); - maDefModel.mbPageOverThenDown = getFlag( nFlags, BIFF_PTDEF2_PAGEOVERTHENDOWN ); - maDefModel.mbSubtotalHiddenItems = getFlag( nFlags, BIFF_PTDEF2_SUBTOTALHIDDENITEMS ); - maDefModel.mbMergeItem = getFlag( nFlags, BIFF_PTDEF2_MERGEITEM ); - } -} - -void PivotTable::importPTRowColFields( BiffInputStream& rStrm ) -{ - // first PTROWCOLFIELDS record contains row fields unless there are no row fields - if( (maDefModel.mnRowFields > 0) && maRowFields.empty() ) - importFields( maRowFields, rStrm, maDefModel.mnRowFields ); - else if( (maDefModel.mnColFields > 0) && maColFields.empty() ) - importFields( maColFields, rStrm, maDefModel.mnColFields ); -} - -void PivotTable::importPTPageFields( BiffInputStream& rStrm ) -{ - while( rStrm.getRemaining() >= 6 ) - { - PTPageFieldModel aModel; - sal_Int16 nField, nItem; - rStrm >> nField >> nItem; - rStrm.skip( 2 ); // dropdown object ID - aModel.mnField = nField; - aModel.mnItem = (nItem == BIFF_PTPAGEFIELDS_ALLITEMS) ? BIFF12_PTPAGEFIELD_MULTIITEMS : nItem; - maPageFields.push_back( aModel ); - } -} - -void PivotTable::importPTDataField( BiffInputStream& rStrm ) -{ - PTDataFieldModel aModel; - sal_Int16 nField, nBaseField, nBaseItem; - sal_uInt16 nSubtotal, nShowDataAs, nNumFmt, nNameLen; - rStrm >> nField >> nSubtotal >> nShowDataAs >> nBaseField >> nBaseItem >> nNumFmt >> nNameLen; - aModel.maName = lclReadPivotString( *this, rStrm, nNameLen ); - - aModel.mnField = nField; - aModel.setBiffSubtotal( nSubtotal ); - aModel.setBiffShowDataAs( nShowDataAs ); - aModel.mnBaseField = nBaseField; - switch( nBaseItem ) - { - case BIFF_PTDATAFIELD_PREVIOUS: aModel.mnBaseItem = OOX_PT_PREVIOUS_ITEM; break; - case BIFF_PTDATAFIELD_NEXT: aModel.mnBaseItem = OOX_PT_NEXT_ITEM; break; - default: aModel.mnBaseItem = nBaseItem; - } - aModel.mnNumFmtId = nNumFmt; - - maDataFields.push_back( aModel ); -} - PivotTableField& PivotTable::createTableField() { sal_Int32 nFieldIndex = static_cast< sal_Int32 >( maFields.size() ); |