sc/source/filter/inc/autofiltercontext.hxx | 15 -- sc/source/filter/inc/biffcodec.hxx | 3 sc/source/filter/inc/drawingmanager.hxx | 2 sc/source/filter/inc/externallinkfragment.hxx | 28 ---- sc/source/filter/oox/autofiltercontext.cxx | 17 -- sc/source/filter/oox/biffcodec.cxx | 8 - sc/source/filter/oox/drawingmanager.cxx | 37 ----- sc/source/filter/oox/externallinkfragment.cxx | 172 -------------------------- unusedcode.easy | 4 9 files changed, 286 deletions(-)
New commits: commit 6266d51db89429f16d4e4bc4ccb4c896096cda90 Author: Julien Nabet <serval2...@yahoo.fr> Date: Sun Apr 8 19:18:42 2012 +0200 Keep on cleaning oox diff --git a/sc/source/filter/inc/autofiltercontext.hxx b/sc/source/filter/inc/autofiltercontext.hxx index 6583fd3..e10f24e 100644 --- a/sc/source/filter/inc/autofiltercontext.hxx +++ b/sc/source/filter/inc/autofiltercontext.hxx @@ -94,21 +94,6 @@ private: // ============================================================================ -class BiffAutoFilterContext : public BiffWorksheetContextBase -{ -public: - explicit BiffAutoFilterContext( const WorksheetHelper& rHelper, AutoFilter& rAutoFilter ); - -protected: - /** Imports all records related to the current auto filter. */ - virtual void importRecord( BiffInputStream& rStrm ); - -private: - AutoFilter& mrAutoFilter; -}; - -// ============================================================================ - } // namespace xls } // namespace oox diff --git a/sc/source/filter/inc/biffcodec.hxx b/sc/source/filter/inc/biffcodec.hxx index 672a816..704df9f 100644 --- a/sc/source/filter/inc/biffcodec.hxx +++ b/sc/source/filter/inc/biffcodec.hxx @@ -168,9 +168,6 @@ class BiffCodecHelper : public WorkbookHelper public: explicit BiffCodecHelper( const WorkbookHelper& rHelper ); - /** Implementation helper, reads the FILEPASS and returns a decoder object. */ - static BiffDecoderRef implReadFilePass( BiffInputStream& rStrm, BiffType eBiff ); - /** Clones the contained decoder object if existing and sets it at the passed stream. */ void cloneDecoder( BiffInputStream& rStrm ); diff --git a/sc/source/filter/inc/drawingmanager.hxx b/sc/source/filter/inc/drawingmanager.hxx index b80d79f..6a713e0 100644 --- a/sc/source/filter/inc/drawingmanager.hxx +++ b/sc/source/filter/inc/drawingmanager.hxx @@ -422,8 +422,6 @@ public: explicit BiffDrawingBase( const WorksheetHelper& rHelper, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& rxDrawPage ); - /** Imports a plain OBJ record (without leading DFF data). */ - void importObj( BiffInputStream& rStrm ); /** Sets the object with the passed identifier to be skipped on import. */ void setSkipObj( sal_uInt16 nObjId ); diff --git a/sc/source/filter/inc/externallinkfragment.hxx b/sc/source/filter/inc/externallinkfragment.hxx index 8324f4f..3c90791 100644 --- a/sc/source/filter/inc/externallinkfragment.hxx +++ b/sc/source/filter/inc/externallinkfragment.hxx @@ -113,34 +113,6 @@ private: }; // ============================================================================ -// ============================================================================ - -class BiffExternalSheetDataContext : public BiffWorkbookContextBase -{ -public: - explicit BiffExternalSheetDataContext( const WorkbookHelper& rHelper, bool bImportDefNames ); - virtual ~BiffExternalSheetDataContext(); - - /** Tries to import a record related to external links and defined names. */ - virtual void importRecord( BiffInputStream& rStrm ); - -private: - void importExternSheet( BiffInputStream& rStrm ); - void importExternalBook( BiffInputStream& rStrm ); - void importExternalName( BiffInputStream& rStrm ); - void importXct( BiffInputStream& rStrm ); - void importCrn( BiffInputStream& rStrm ); - void importDefinedName( BiffInputStream& rStrm ); - - /** Sets the passed cell value to the passed position in the sheet cache. */ - void setCellValue( const BinAddress& rBinAddr, const ::com::sun::star::uno::Any& rValue ); - -private: - ExternalLinkRef mxExtLink; /// Current external link. - ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XExternalSheetCache > - mxSheetCache; /// The sheet cache used to store external cell values. - bool mbImportDefNames; -}; } // namespace xls } // namespace oox diff --git a/sc/source/filter/oox/autofiltercontext.cxx b/sc/source/filter/oox/autofiltercontext.cxx index c58cb4d..52f6f0a 100644 --- a/sc/source/filter/oox/autofiltercontext.cxx +++ b/sc/source/filter/oox/autofiltercontext.cxx @@ -163,23 +163,6 @@ void AutoFilterContext::onStartRecord( SequenceInputStream& rStrm ) // ============================================================================ -BiffAutoFilterContext::BiffAutoFilterContext( const WorksheetHelper& rHelper, AutoFilter& rAutoFilter ) : - BiffWorksheetContextBase( rHelper ), - mrAutoFilter( rAutoFilter ) -{ -} - -void BiffAutoFilterContext::importRecord( BiffInputStream& rStrm ) -{ - switch( rStrm.getRecId() ) - { - // nothing to read for BIFF_ID_AUTOFILTER - case BIFF_ID_FILTERCOLUMN: mrAutoFilter.createFilterColumn().importFilterColumn( rStrm ); break; - } -} - -// ============================================================================ - } // namespace xls } // namespace oox diff --git a/sc/source/filter/oox/biffcodec.cxx b/sc/source/filter/oox/biffcodec.cxx index a5808e5..26fee95 100644 --- a/sc/source/filter/oox/biffcodec.cxx +++ b/sc/source/filter/oox/biffcodec.cxx @@ -349,14 +349,6 @@ BiffCodecHelper::BiffCodecHelper( const WorkbookHelper& rHelper ) : { } -/*static*/ BiffDecoderRef BiffCodecHelper::implReadFilePass( BiffInputStream& rStrm, BiffType eBiff ) -{ - rStrm.enableDecoder( false ); - BiffDecoderRef xDecoder = (eBiff == BIFF8) ? lclReadFilePassBiff8( rStrm ) : lclReadFilePass_XOR( rStrm ); - rStrm.setDecoder( xDecoder ); - return xDecoder; -} - void BiffCodecHelper::cloneDecoder( BiffInputStream& rStrm ) { if( mxDecoder.get() ) diff --git a/sc/source/filter/oox/drawingmanager.cxx b/sc/source/filter/oox/drawingmanager.cxx index 8a1754a..1e00ff7 100644 --- a/sc/source/filter/oox/drawingmanager.cxx +++ b/sc/source/filter/oox/drawingmanager.cxx @@ -1089,43 +1089,6 @@ BiffDrawingBase::BiffDrawingBase( const WorksheetHelper& rHelper, const Referenc { } -void BiffDrawingBase::importObj( BiffInputStream& rStrm ) -{ - BiffDrawingObjectRef xDrawingObj; - -#if 0 - /* #i61786# In BIFF8 streams, OBJ records may occur without MSODRAWING - records. In this case, the OBJ records are in BIFF5 format. Do a sanity - check here that there is no DFF data loaded before. */ - DBG_ASSERT( maDffStrm.Tell() == 0, "BiffDrawingBase::importObj - unexpected DFF stream data, OBJ will be ignored" ); - if( maDffStrm.Tell() == 0 ) switch( GetBiff() ) -#else - switch( getBiff() ) -#endif - { - case BIFF3: - xDrawingObj = BiffDrawingObjectBase::importObjBiff3( *this, rStrm ); - break; - case BIFF4: - xDrawingObj = BiffDrawingObjectBase::importObjBiff4( *this, rStrm ); - break; - case BIFF5: -// TODO: add BIFF8 when DFF is supported -// case BIFF8: - xDrawingObj = BiffDrawingObjectBase::importObjBiff5( *this, rStrm ); - break; - default:; - } - - if( xDrawingObj.get() ) - { - // insert into maRawObjs or into the last open group object - maRawObjs.insertGrouped( xDrawingObj ); - // to be able to find objects by ID - maObjMapId[ xDrawingObj->getObjId() ] = xDrawingObj; - } -} - void BiffDrawingBase::finalizeImport() { Reference< XShapes > xShapes( mxDrawPage, UNO_QUERY ); diff --git a/sc/source/filter/oox/externallinkfragment.cxx b/sc/source/filter/oox/externallinkfragment.cxx index a981cf3..d35b5a7 100644 --- a/sc/source/filter/oox/externallinkfragment.cxx +++ b/sc/source/filter/oox/externallinkfragment.cxx @@ -347,178 +347,6 @@ const RecordInfo* ExternalLinkFragment::getRecordInfos() const } // ============================================================================ -// ============================================================================ - -BiffExternalSheetDataContext::BiffExternalSheetDataContext( const WorkbookHelper& rHelper, bool bImportDefNames ) : - BiffWorkbookContextBase( rHelper ), - mbImportDefNames( bImportDefNames ) -{ -} - -BiffExternalSheetDataContext::~BiffExternalSheetDataContext() -{ -} - -void BiffExternalSheetDataContext::importRecord( BiffInputStream& rStrm ) -{ - sal_uInt16 nRecId = rStrm.getRecId(); - switch( getBiff() ) - { - case BIFF2: switch( nRecId ) - { - case BIFF2_ID_EXTERNALNAME: importExternalName( rStrm ); break; - case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break; - case BIFF2_ID_DEFINEDNAME: importDefinedName( rStrm ); break; - } - break; - case BIFF3: switch( nRecId ) - { - case BIFF_ID_CRN: importCrn( rStrm ); break; - case BIFF3_ID_EXTERNALNAME: importExternalName( rStrm ); break; - case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break; - case BIFF3_ID_DEFINEDNAME: importDefinedName( rStrm ); break; - case BIFF_ID_XCT: importXct( rStrm ); break; - } - break; - case BIFF4: switch( nRecId ) - { - case BIFF_ID_CRN: importCrn( rStrm ); break; - case BIFF3_ID_EXTERNALNAME: importExternalName( rStrm ); break; - case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break; - case BIFF3_ID_DEFINEDNAME: importDefinedName( rStrm ); break; - case BIFF_ID_XCT: importXct( rStrm ); break; - } - break; - case BIFF5: switch( nRecId ) - { - case BIFF_ID_CRN: importCrn( rStrm ); break; - case BIFF5_ID_EXTERNALNAME: importExternalName( rStrm ); break; - case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break; - case BIFF5_ID_DEFINEDNAME: importDefinedName( rStrm ); break; - case BIFF_ID_XCT: importXct( rStrm ); break; - } - break; - case BIFF8: switch( nRecId ) - { - case BIFF_ID_CRN: importCrn( rStrm ); break; - case BIFF_ID_EXTERNALBOOK: importExternalBook( rStrm ); break; - case BIFF5_ID_EXTERNALNAME: importExternalName( rStrm ); break; - case BIFF_ID_EXTERNSHEET: importExternSheet( rStrm ); break; - case BIFF5_ID_DEFINEDNAME: importDefinedName( rStrm ); break; - case BIFF_ID_XCT: importXct( rStrm ); break; - } - break; - case BIFF_UNKNOWN: break; - } -} - -// private -------------------------------------------------------------------- - -void BiffExternalSheetDataContext::importExternSheet( BiffInputStream& rStrm ) -{ - mxSheetCache.clear(); - if( getBiff() == BIFF8 ) - getExternalLinks().importExternSheet8( rStrm ); - else - mxExtLink = getExternalLinks().importExternSheet( rStrm ); -} - -void BiffExternalSheetDataContext::importExternalBook( BiffInputStream& rStrm ) -{ - mxSheetCache.clear(); - mxExtLink = getExternalLinks().importExternalBook( rStrm ); -} - -void BiffExternalSheetDataContext::importExternalName( BiffInputStream& rStrm ) -{ - if( mxExtLink.get() ) - mxExtLink->importExternalName( rStrm ); -} - -void BiffExternalSheetDataContext::importXct( BiffInputStream& rStrm ) -{ - mxSheetCache.clear(); - if( mxExtLink.get() && (mxExtLink->getLinkType() == LINKTYPE_EXTERNAL) ) - { - switch( getBiff() ) - { - case BIFF2: - break; - case BIFF3: - case BIFF4: - case BIFF5: - mxSheetCache = mxExtLink->getSheetCache( 0 ); - break; - case BIFF8: - rStrm.skip( 2 ); - mxSheetCache = mxExtLink->getSheetCache( rStrm.readInt16() ); - break; - case BIFF_UNKNOWN: - break; - } - } -} - -void BiffExternalSheetDataContext::importCrn( BiffInputStream& rStrm ) -{ - if( !mxSheetCache.is() ) return; - - sal_uInt8 nCol2, nCol1; - sal_uInt16 nRow; - rStrm >> nCol2 >> nCol1 >> nRow; - bool bLoop = true; - for( BinAddress aBinAddr( nCol1, nRow ); bLoop && !rStrm.isEof() && (aBinAddr.mnCol <= nCol2); ++aBinAddr.mnCol ) - { - switch( rStrm.readuInt8() ) - { - case BIFF_DATATYPE_EMPTY: - rStrm.skip( 8 ); - setCellValue( aBinAddr, Any( OUString() ) ); - break; - case BIFF_DATATYPE_DOUBLE: - setCellValue( aBinAddr, Any( rStrm.readDouble() ) ); - break; - case BIFF_DATATYPE_STRING: - { - OUString aText = (getBiff() == BIFF8) ? rStrm.readUniString() : rStrm.readByteStringUC( false, getTextEncoding() ); - setCellValue( aBinAddr, Any( aText ) ); - } - break; - case BIFF_DATATYPE_BOOL: - { - double fValue = (rStrm.readuInt8() == 0) ? 0.0 : 1.0; - setCellValue( aBinAddr, Any( fValue ) ); - rStrm.skip( 7 ); - } - break; - case BIFF_DATATYPE_ERROR: - setCellValue( aBinAddr, Any( BiffHelper::calcDoubleFromError( rStrm.readuInt8() ) ) ); - rStrm.skip( 7 ); - break; - default: - OSL_FAIL( "BiffExternalSheetDataContext::importCrn - unknown data type" ); - bLoop = false; - } - } -} - -void BiffExternalSheetDataContext::importDefinedName( BiffInputStream& rStrm ) -{ - if( mbImportDefNames ) - getDefinedNames().importDefinedName( rStrm ); -} - -void BiffExternalSheetDataContext::setCellValue( const BinAddress& rBinAddr, const Any& rValue ) -{ - CellAddress aCellPos; - if( mxSheetCache.is() && getAddressConverter().convertToCellAddress( aCellPos, rBinAddr, 0, false ) ) try - { - mxSheetCache->setCellValue( aCellPos.Column, aCellPos.Row, rValue ); - } - catch( Exception& ) - { - } -} } // namespace xls } // namespace oox diff --git a/unusedcode.easy b/unusedcode.easy index 6fe8ca6..34759c6 100755 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -797,10 +797,6 @@ oox::core::FilterBase::requestEncryptionData(comphelper::IDocPasswordVerifier&) oox::dump::SequenceRecordObjectBase::construct(oox::dump::OutputObjectBase const&, oox::dump::BinaryInputStreamRef const&, oox::dump::String const&, oox::dump::String const&) oox::dump::StringHelper::appendRange(rtl::OUStringBuffer&, oox::dump::TokenRange const&, bool) oox::dump::StringHelper::appendRangeList(rtl::OUStringBuffer&, std::__debug::vector<oox::dump::Range, std::allocator<oox::dump::Range> > const&) -oox::xls::BiffAutoFilterContext::BiffAutoFilterContext(oox::xls::WorksheetHelper const&, oox::xls::AutoFilter&) -oox::xls::BiffCodecHelper::implReadFilePass(oox::xls::BiffInputStream&, oox::xls::BiffType) -oox::xls::BiffDrawingBase::importObj(oox::xls::BiffInputStream&) -oox::xls::BiffExternalSheetDataContext::BiffExternalSheetDataContext(oox::xls::WorkbookHelper const&, bool) oox::xls::BiffInputStream::tellBase() const oox::xls::BiffPivotTableContext::BiffPivotTableContext(oox::xls::WorksheetHelper const&) oox::xls::BiffQueryTableContext::BiffQueryTableContext(oox::xls::WorksheetHelper const&) _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits