Simplify logic

Change-Id: I2350c1a4d57a0e25753756e99d2b93ab3f2f6997
This commit is contained in:
Stephan Bergmann
2014-05-21 11:59:48 +02:00
parent e05a200249
commit 5e82dc511e

View File

@@ -316,19 +316,13 @@ void PPDDecompressStream::Open( const OUString& i_rFile )
mpFileStream->Seek( 0 );
// check for compress'ed or gzip'ed file
sal_uLong nCompressMethod = 0;
if( aLine.getLength() > 1 && static_cast<unsigned char>(aLine[0]) == 0x1f )
{
if( static_cast<unsigned char>(aLine[1]) == 0x8b ) // check for gzip
nCompressMethod = ZCODEC_DEFAULT_COMPRESSION | ZCODEC_GZ_LIB;
}
if( nCompressMethod != 0 )
if( aLine.getLength() > 1 && static_cast<unsigned char>(aLine[0]) == 0x1f
&& static_cast<unsigned char>(aLine[1]) == 0x8b /* check for gzip */ )
{
// so let's try to decompress the stream
mpMemStream = new SvMemoryStream( 4096, 4096 );
ZCodec aCodec;
aCodec.BeginCompression( nCompressMethod );
aCodec.BeginCompression( ZCODEC_DEFAULT_COMPRESSION | ZCODEC_GZ_LIB );
long nComp = aCodec.Decompress( *mpFileStream, *mpMemStream );
aCodec.EndCompression();
if( nComp < 0 )