diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-04-07 15:53:56 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-04-07 15:54:16 +0100 |
commit | aefbfc7101bb9b4ef20968d45306ab97573f6597 (patch) | |
tree | 314a80042f59b05443276d6e311d0cbc71684087 /sc | |
parent | 3f2b771e5f53a7f079416ae6fc42625420b725d7 (diff) |
callcatcher: update and remove newly unused methods
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/inc/biffhelper.hxx | 3 | ||||
-rw-r--r-- | sc/source/filter/oox/biffhelper.cxx | 98 |
2 files changed, 0 insertions, 101 deletions
diff --git a/sc/source/filter/inc/biffhelper.hxx b/sc/source/filter/inc/biffhelper.hxx index 5f390fa2fb4f..e22f3b4db991 100644 --- a/sc/source/filter/inc/biffhelper.hxx +++ b/sc/source/filter/inc/biffhelper.hxx @@ -641,9 +641,6 @@ public: */ static bool skipRecordBlock( BiffInputStream& rStrm, sal_uInt16 nEndRecId ); - /** Imports a picture from an IMGDATA record. */ - static void importImgData( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, BiffType eBiff ); - private: BiffHelper(); // not implemented ~BiffHelper(); // not implemented diff --git a/sc/source/filter/oox/biffhelper.cxx b/sc/source/filter/oox/biffhelper.cxx index ec6153938b88..b7241a9347a2 100644 --- a/sc/source/filter/oox/biffhelper.cxx +++ b/sc/source/filter/oox/biffhelper.cxx @@ -69,84 +69,6 @@ union DecodedDouble inline explicit DecodedDouble( double fValue ) : mfValue( fValue ) {} }; -// ---------------------------------------------------------------------------- - -void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, sal_Int32 nBytes, BiffType eBiff ) -{ - /* The IMGDATA record for bitmap format contains a Windows DIB (a bitmap - file without the 'BITMAPFILEHEADER' header structure). Usually, the DIB - header consists of 12 bytes (called 'OS/2 V1 header' or - 'BITMAPCOREHEADER', see http://en.wikipedia.org/wiki/BMP_file_format) - followed by the remaining pixel data, but the 'Windows V3' or - 'BITMAPINFOHEADER' is also supported here. This function creates a - complete 'BMP file' that can be read by the OOo graphic provider used - to import graphic objects. For that, the BITMAPFILEHEADER has to be - inserted before the DIB data, and it has to contain the correct offset - to the pixel data. Currently, in real life there are only 24-bit and - 32-bit DIBs (without color palette) in use. This code relies on this - fact and calculates the offset to the pixel data according to the size - of the DIB header. - Remaining tasks are (if really used somewhere): - - Support of DIBs with color palette, - - Support of 'Windows V4' and 'Windows V5' DIB header. */ - - // read and check validity of DIB header - sal_Int64 nInStrmPos = rStrm.tell(); - sal_Int32 nDibHdrSize = rStrm.readInt32(); - sal_uInt16 nPlanes = 0, nDepth = 0; - switch( nDibHdrSize ) - { - case BITMAPCOREHEADER_SIZE: - rStrm.skip( 4 ); // width/height as 16-bit integer - rStrm >> nPlanes >> nDepth; - break; - case BITMAPINFOHEADER_SIZE: - rStrm.skip( 8 ); // width/height as 32-bit integer - rStrm >> nPlanes >> nDepth; - break; - } - rStrm.seek( nInStrmPos ); - - if( (nPlanes == 1) && ((nDepth == 24) || (nDepth == 32)) ) - { - // allocate enough space for the BITMAPFILEHEADER and the DIB data - orDataSeq.realloc( BITMAPFILEHEADER_SIZE + nBytes ); - SequenceOutputStream aOutStrm( orDataSeq ); - - // write the BITMAPFILEHEADER of a regular BMP file - sal_Int32 nBmpSize = BITMAPFILEHEADER_SIZE + nBytes; - sal_Int32 nOffset = BITMAPFILEHEADER_SIZE + nDibHdrSize; - aOutStrm << sal_uInt16( 0x4D42 ) << nBmpSize << sal_Int32( 0 ) << nOffset; - - // copy the DIB header - rStrm.copyToStream( aOutStrm, nDibHdrSize ); - nBytes -= nDibHdrSize; - - /* Excel 3.x and Excel 4.x seem to write broken or out-dated DIB data. - Usually they write a BITMAPCOREHEADER containing width, height, - planes as usual. The pixel depth field is set to 32 bit (though - this is not allowed according to documentation). Between that - header and the actual pixel data, 3 unused bytes are inserted. This - does even confuse Excel 5.x and later, which cannot read the image - data correctly. */ - if( (eBiff <= BIFF4) && (nDibHdrSize == BITMAPCOREHEADER_SIZE) && (nDepth == 32) ) - { - // skip the dummy bytes in input stream - rStrm.skip( 3 ); - nBytes -= 3; - // correct the total BMP file size in output stream - sal_Int64 nOutStrmPos = aOutStrm.tell(); - aOutStrm.seek( 2 ); - aOutStrm << sal_Int32( nBmpSize - 3 ); - aOutStrm.seek( nOutStrmPos ); - } - - // copy remaining pixel data to output stream - rStrm.copyToStream( aOutStrm, nBytes ); - } - rStrm.seek( nInStrmPos + nBytes ); -} - } // namespace // ============================================================================ @@ -248,26 +170,6 @@ void lclImportImgDataDib( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, return !rStrm.isEof() && (rStrm.getRecId() == nEndRecId); } -/*static*/ void BiffHelper::importImgData( StreamDataSequence& orDataSeq, BiffInputStream& rStrm, BiffType eBiff ) -{ - sal_uInt16 nFormat, nEnv; - sal_Int32 nBytes; - rStrm >> nFormat >> nEnv >> nBytes; - OSL_ENSURE( nBytes > 0, "BiffHelper::importImgData - invalid data size" ); - if( (0 < nBytes) && (nBytes <= rStrm.getRemaining()) ) - { - switch( nFormat ) - { -// case BIFF_IMGDATA_WMF: /* TODO */ break; - case BIFF_IMGDATA_DIB: lclImportImgDataDib( orDataSeq, rStrm, nBytes, eBiff ); break; -// case BIFF_IMGDATA_NATIVE: /* TODO */ break; - default: OSL_FAIL( "BiffHelper::importImgData - unknown image format" ); - } - } -} - -// ============================================================================ - } // namespace xls } // namespace oox |