From 226d310c1a31238b7f07d8e7e42ec75f0280fba5 Mon Sep 17 00:00:00 2001 From: Petr Vorel Date: Thu, 22 Mar 2012 20:14:13 +0100 Subject: remove unused code (oox) --- sc/source/filter/inc/biffinputstream.hxx | 27 +----------- sc/source/filter/inc/biffoutputstream.hxx | 5 --- sc/source/filter/inc/drawingmanager.hxx | 4 -- sc/source/filter/oox/biffdetector.cxx | 5 --- sc/source/filter/oox/biffinputstream.cxx | 11 ----- sc/source/filter/oox/biffoutputstream.cxx | 16 ------- sc/source/filter/oox/drawingmanager.cxx | 71 ------------------------------- sc/source/filter/oox/excelfilter.cxx | 27 ------------ sc/source/filter/oox/ooxformulaparser.cxx | 5 --- 9 files changed, 1 insertion(+), 170 deletions(-) (limited to 'sc') diff --git a/sc/source/filter/inc/biffinputstream.hxx b/sc/source/filter/inc/biffinputstream.hxx index 9f01b023a074..47ee2b0d4637 100644 --- a/sc/source/filter/inc/biffinputstream.hxx +++ b/sc/source/filter/inc/biffinputstream.hxx @@ -129,16 +129,7 @@ private: Trying to read over the record limits results in a stream error. The isValid() function indicates that by returning false. From now on the data returned by the read functions is undefined. The error state will be reset, - if the record is reset (with the function resetRecord()), or if the next - record is started. - - To switch off the automatic lookup of CONTINUE records, use resetRecord() - with false parameter. This is useful e.g. on import of drawing layer data, - where sometimes solely CONTINUE records will occur. The automatic lookup - keeps switched off until the method resetRecord() is called with parameter - true. All other settings done on the stream (e.g. alternative CONTINUE - record identifier, enabled decryption, NUL substitution character) will be - reset to default values, if a new record is started. + if the next record is started. The import stream supports decrypting the stream data. The contents of a record (not the record header) will be encrypted by Excel if the file has @@ -189,22 +180,6 @@ public: */ bool startRecordByHandle( sal_Int64 nRecHandle ); - /** Sets stream pointer to begin of record content. - - @param bContLookup - Automatic CONTINUE lookup on/off. In difference to other stream - settings, this setting is persistent until next call of this - function (because it is wanted to receive the next CONTINUE records - separately). - @param nAltContId - Sets an alternative record identifier for content continuation. - This value is reset automatically when a new record is started with - startNextRecord(). - */ - void resetRecord( - bool bContLookup, - sal_uInt16 nAltContId = BIFF_ID_UNKNOWN ); - /** Sets stream pointer before current record and invalidates stream. The next call to startNextRecord() will start again the current record. diff --git a/sc/source/filter/inc/biffoutputstream.hxx b/sc/source/filter/inc/biffoutputstream.hxx index a38bfdfce488..f7a64625dea9 100644 --- a/sc/source/filter/inc/biffoutputstream.hxx +++ b/sc/source/filter/inc/biffoutputstream.hxx @@ -110,8 +110,6 @@ public: /** Returns the absolute position in the wrapped binary stream. */ sal_Int64 tellBase() const; - /** Returns the total size of the wrapped binary stream. */ - sal_Int64 sizeBase() const; // BinaryOutputStream interface (stream write access) --------------------- @@ -120,9 +118,6 @@ public: /** Writes nBytes bytes from the passed buffer pMem. */ virtual void writeMemory( const void* pMem, sal_Int32 nBytes, size_t nAtomSize = 1 ); - /** Writes a sequence of nBytes bytes with the passed value. */ - void fill( sal_uInt8 nValue, sal_Int32 nBytes, size_t nAtomSize = 1 ); - /** Stream operator for all data types supported by the writeValue() function. */ template< typename Type > inline BiffOutputStream& operator<<( Type nValue ) { writeValue( nValue ); return *this; } diff --git a/sc/source/filter/inc/drawingmanager.hxx b/sc/source/filter/inc/drawingmanager.hxx index c597b0306b27..f2f018ef2ccd 100644 --- a/sc/source/filter/inc/drawingmanager.hxx +++ b/sc/source/filter/inc/drawingmanager.hxx @@ -95,8 +95,6 @@ public: /** Returns true, if the object list is empty. */ inline bool empty() const { return maObjects.empty(); } - /** Appends the passed object to the list of objects. */ - void append( const BiffDrawingObjectRef& rxDrawingObj ); /** Tries to insert the passed object into the last group or appends it. */ void insertGrouped( const BiffDrawingObjectRef& rxDrawingObj ); @@ -197,8 +195,6 @@ private: void importObjBiff4( BiffInputStream& rStrm ); /** Reads the contents of a BIFF5 OBJ record. */ void importObjBiff5( BiffInputStream& rStrm ); - /** Reads the contents of a BIFF8 OBJ record. */ - void importObjBiff8( BiffInputStream& rStrm ); private: ShapeAnchor maAnchor; /// Position of the drawing object. diff --git a/sc/source/filter/oox/biffdetector.cxx b/sc/source/filter/oox/biffdetector.cxx index 5c5a2c26ef41..b099ad24f97e 100644 --- a/sc/source/filter/oox/biffdetector.cxx +++ b/sc/source/filter/oox/biffdetector.cxx @@ -64,11 +64,6 @@ OUString BiffDetector_getImplementationName() return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.BiffDetector" ); } -Reference< XInterface > SAL_CALL BiffDetector_createInstance( const Reference< XComponentContext >& rxContext ) throw( Exception ) -{ - return static_cast< ::cppu::OWeakObject* >( new BiffDetector( rxContext ) ); -} - // ============================================================================ BiffDetector::BiffDetector( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : diff --git a/sc/source/filter/oox/biffinputstream.cxx b/sc/source/filter/oox/biffinputstream.cxx index 71641f51ba2d..535359bf8e17 100644 --- a/sc/source/filter/oox/biffinputstream.cxx +++ b/sc/source/filter/oox/biffinputstream.cxx @@ -213,17 +213,6 @@ bool BiffInputStream::startRecordByHandle( sal_Int64 nRecHandle ) return startNextRecord(); } -void BiffInputStream::resetRecord( bool bContLookup, sal_uInt16 nAltContId ) -{ - if( isInRecord() ) - { - mbCont = bContLookup; - mnAltContId = nAltContId; - restartRecord( true ); - maRecBuffer.enableDecoder( true ); - } -} - void BiffInputStream::rewindRecord() { rewindToRecord( mnRecHandle ); diff --git a/sc/source/filter/oox/biffoutputstream.cxx b/sc/source/filter/oox/biffoutputstream.cxx index 8914cf1f9f69..0b2524cbef36 100644 --- a/sc/source/filter/oox/biffoutputstream.cxx +++ b/sc/source/filter/oox/biffoutputstream.cxx @@ -107,11 +107,6 @@ sal_Int64 BiffOutputStream::tellBase() const return maRecBuffer.getBaseStream().tell(); } -sal_Int64 BiffOutputStream::sizeBase() const -{ - return maRecBuffer.getBaseStream().size(); -} - // BinaryOutputStream interface (stream write access) ------------------------- void BiffOutputStream::writeData( const StreamDataSequence& rData, size_t nAtomSize ) @@ -136,17 +131,6 @@ void BiffOutputStream::writeMemory( const void* pMem, sal_Int32 nBytes, size_t n } } -void BiffOutputStream::fill( sal_uInt8 nValue, sal_Int32 nBytes, size_t nAtomSize ) -{ - sal_Int32 nBytesLeft = nBytes; - while( nBytesLeft > 0 ) - { - sal_uInt16 nBlockSize = prepareWriteBlock( nBytesLeft, nAtomSize ); - maRecBuffer.fill( nValue, nBlockSize ); - nBytesLeft -= nBlockSize; - } -} - // private -------------------------------------------------------------------- sal_uInt16 BiffOutputStream::prepareWriteBlock( sal_Int32 nTotalSize, size_t nAtomSize ) diff --git a/sc/source/filter/oox/drawingmanager.cxx b/sc/source/filter/oox/drawingmanager.cxx index a1cfef9a4b32..a50e8056aa76 100644 --- a/sc/source/filter/oox/drawingmanager.cxx +++ b/sc/source/filter/oox/drawingmanager.cxx @@ -230,11 +230,6 @@ BiffDrawingObjectContainer::BiffDrawingObjectContainer() { } -void BiffDrawingObjectContainer::append( const BiffDrawingObjectRef& rxDrawingObj ) -{ - maObjects.push_back( rxDrawingObj ); -} - void BiffDrawingObjectContainer::insertGrouped( const BiffDrawingObjectRef& rxDrawingObj ) { if( !maObjects.empty() ) @@ -745,72 +740,6 @@ void BiffDrawingObjectBase::importObjBiff5( BiffInputStream& rStrm ) implReadObjBiff5( rStrm, nNameLen, nMacroSize ); } -void BiffDrawingObjectBase::importObjBiff8( BiffInputStream& rStrm ) -{ - // back to beginning - rStrm.seekToStart(); - - bool bLoop = true; - while( bLoop && (rStrm.getRemaining() >= 4) ) - { - sal_uInt16 nSubRecId, nSubRecSize; - rStrm >> nSubRecId >> nSubRecSize; - sal_Int64 nStrmPos = rStrm.tell(); - // sometimes the last subrecord has an invalid length (OBJLBSDATA) -> min() - nSubRecSize = static_cast< sal_uInt16 >( ::std::min< sal_Int64 >( nSubRecSize, rStrm.getRemaining() ) ); - - switch( nSubRecId ) - { - case BIFF_ID_OBJCMO: - OSL_ENSURE( rStrm.tell() == 4, "BiffDrawingObjectBase::importObjBiff8 - unexpected OBJCMO subrecord" ); - if( (rStrm.tell() == 4) && (nSubRecSize >= 6) ) - { - sal_uInt16 nObjFlags; - rStrm >> mnObjType >> mnObjId >> nObjFlags; - mbPrintable = getFlag( nObjFlags, BIFF_OBJCMO_PRINTABLE ); - } - break; - case BIFF_ID_OBJMACRO: - readMacroBiff8( rStrm ); - break; - case BIFF_ID_OBJEND: - bLoop = false; - break; - default: - implReadObjBiff8SubRec( rStrm, nSubRecId, nSubRecSize ); - } - - // seek to end of subrecord - rStrm.seek( nStrmPos + nSubRecSize ); - } - - /* Call doReadObj8SubRec() with BIFF_ID_OBJEND for further stream - processing (e.g. charts), even if the OBJEND subrecord is missing. */ - implReadObjBiff8SubRec( rStrm, BIFF_ID_OBJEND, 0 ); - - /* Pictures that Excel reads from BIFF5 and writes to BIFF8 still have the - IMGDATA record following the OBJ record (but they use the image data - stored in DFF). The IMGDATA record may be continued by several CONTINUE - records. But the last CONTINUE record may be in fact an MSODRAWING - record that contains the DFF data of the next drawing object! So we - have to skip just enough CONTINUE records to look at the next - MSODRAWING/CONTINUE record. */ - if( (rStrm.getNextRecId() == BIFF3_ID_IMGDATA) && rStrm.startNextRecord() ) - { - rStrm.skip( 4 ); - sal_Int64 nDataSize = rStrm.readuInt32(); - nDataSize -= rStrm.getRemaining(); - // skip following CONTINUE records until IMGDATA ends - while( (nDataSize > 0) && (rStrm.getNextRecId() == BIFF_ID_CONT) && rStrm.startNextRecord() ) - { - OSL_ENSURE( nDataSize >= rStrm.getRemaining(), "BiffDrawingObjectBase::importObjBiff8 - CONTINUE too long" ); - nDataSize -= ::std::min( rStrm.getRemaining(), nDataSize ); - } - OSL_ENSURE( nDataSize == 0, "BiffDrawingObjectBase::importObjBiff8 - missing CONTINUE records" ); - // next record may be MSODRAWING or CONTINUE or anything else - } -} - // ============================================================================ BiffPlaceholderObject::BiffPlaceholderObject( const WorksheetHelper& rHelper ) : diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx index 57c9749e7f96..08f3ec6d6de0 100644 --- a/sc/source/filter/oox/excelfilter.cxx +++ b/sc/source/filter/oox/excelfilter.cxx @@ -212,20 +212,6 @@ OUString SAL_CALL ExcelBiffFilter_getImplementationName() throw() return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelBiffFilter" ); } -Sequence< OUString > SAL_CALL ExcelBiffFilter_getSupportedServiceNames() throw() -{ - Sequence< OUString > aSeq( 2 ); - aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" ); - aSeq[ 1 ] = CREATE_OUSTRING( "com.sun.star.document.ExportFilter" ); - return aSeq; -} - -Reference< XInterface > SAL_CALL ExcelBiffFilter_createInstance( - const Reference< XComponentContext >& rxContext ) throw( Exception ) -{ - return static_cast< ::cppu::OWeakObject* >( new ExcelBiffFilter( rxContext ) ); -} - // ---------------------------------------------------------------------------- ExcelBiffFilter::ExcelBiffFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : @@ -295,19 +281,6 @@ OUString SAL_CALL ExcelVbaProjectFilter_getImplementationName() throw() return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelVbaProjectFilter" ); } -Sequence< OUString > SAL_CALL ExcelVbaProjectFilter_getSupportedServiceNames() throw() -{ - Sequence< OUString > aSeq( 1 ); - aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" ); - return aSeq; -} - -Reference< XInterface > SAL_CALL ExcelVbaProjectFilter_createInstance( - const Reference< XComponentContext >& rxContext ) throw( Exception ) -{ - return static_cast< ::cppu::OWeakObject* >( new ExcelVbaProjectFilter( rxContext ) ); -} - // ---------------------------------------------------------------------------- ExcelVbaProjectFilter::ExcelVbaProjectFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : diff --git a/sc/source/filter/oox/ooxformulaparser.cxx b/sc/source/filter/oox/ooxformulaparser.cxx index ebb5175f4eee..ab2f515efcc7 100644 --- a/sc/source/filter/oox/ooxformulaparser.cxx +++ b/sc/source/filter/oox/ooxformulaparser.cxx @@ -125,11 +125,6 @@ OUString OOXMLFormulaParser_getImplementationName() return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.FormulaParser" ); } -Reference< XInterface > SAL_CALL OOXMLFormulaParser_createInstance( const Reference< XComponentContext >& ) throw( Exception ) -{ - return static_cast< ::cppu::OWeakObject* >( new OOXMLFormulaParser ); -} - // ============================================================================ OOXMLFormulaParser::OOXMLFormulaParser() -- cgit