Kaydet (Commit) 2c2e80da authored tarafından Caolán McNamara's avatar Caolán McNamara

callcatcher: remove newly unused code

and rework reads to just return the read value

Change-Id: I5d2f01064465c65859ec4ba031ec9dfa16403487
üst c928840e
...@@ -88,24 +88,6 @@ LwpSvStream& LwpSvStream::ReadUInt32( sal_uInt32& rUInt32 ) ...@@ -88,24 +88,6 @@ LwpSvStream& LwpSvStream::ReadUInt32( sal_uInt32& rUInt32 )
return *this; return *this;
} }
LwpSvStream& LwpSvStream::ReadInt8( sal_Int8& rInt8 )
{
m_pStream->ReadSChar( rInt8 );
return *this;
}
LwpSvStream& LwpSvStream::ReadInt16( sal_Int16& rInt16 )
{
m_pStream->ReadInt16( rInt16 );
return *this;
}
LwpSvStream& LwpSvStream::ReadInt32( sal_Int32& rInt32 )
{
m_pStream->ReadInt32( rInt32 );
return *this;
}
/** /**
* @descr SeekRel in stream * @descr SeekRel in stream
*/ */
......
...@@ -76,10 +76,6 @@ public: ...@@ -76,10 +76,6 @@ public:
LwpSvStream& ReadUInt16( sal_uInt16& rUInt16 ); LwpSvStream& ReadUInt16( sal_uInt16& rUInt16 );
LwpSvStream& ReadUInt32( sal_uInt32& rUInt32 ); LwpSvStream& ReadUInt32( sal_uInt32& rUInt32 );
LwpSvStream& ReadInt8( sal_Int8& rInt8 );
LwpSvStream& ReadInt16( sal_Int16& rInt16 );
LwpSvStream& ReadInt32( sal_Int32& rInt32 );
static const sal_uInt32 LWP_STREAM_BASE; static const sal_uInt32 LWP_STREAM_BASE;
LwpSvStream * GetCompressedStream() LwpSvStream * GetCompressedStream()
......
...@@ -48,12 +48,37 @@ public: ...@@ -48,12 +48,37 @@ public:
sal_Int64 GetPosition() sal_Int64 GetPosition()
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
ByteChucker& WriteInt8(sal_Int8 nInt8); void WriteInt16(sal_Int16 nInt16)
ByteChucker& WriteInt16(sal_Int16 nInt16); {
ByteChucker& WriteInt32(sal_Int32 nInt32); p2Sequence[0] = static_cast< sal_Int8 >((nInt16 >> 0 ) & 0xFF);
ByteChucker& WriteUInt8(sal_uInt8 nuInt8); p2Sequence[1] = static_cast< sal_Int8 >((nInt16 >> 8 ) & 0xFF);
ByteChucker& WriteUInt16(sal_uInt16 nuInt16); WriteBytes( a2Sequence );
ByteChucker& WriteUInt32(sal_uInt32 nuInt32); }
void WriteInt32(sal_Int32 nInt32)
{
p4Sequence[0] = static_cast< sal_Int8 >((nInt32 >> 0 ) & 0xFF);
p4Sequence[1] = static_cast< sal_Int8 >((nInt32 >> 8 ) & 0xFF);
p4Sequence[2] = static_cast< sal_Int8 >((nInt32 >> 16 ) & 0xFF);
p4Sequence[3] = static_cast< sal_Int8 >((nInt32 >> 24 ) & 0xFF);
WriteBytes( a4Sequence );
}
void WriteUInt16(sal_uInt16 nuInt16)
{
p2Sequence[0] = static_cast< sal_Int8 >((nuInt16 >> 0 ) & 0xFF);
p2Sequence[1] = static_cast< sal_Int8 >((nuInt16 >> 8 ) & 0xFF);
WriteBytes( a2Sequence );
}
void WriteUInt32(sal_uInt32 nuInt32)
{
p4Sequence[0] = static_cast < sal_Int8 > ((nuInt32 >> 0 ) & 0xFF);
p4Sequence[1] = static_cast < sal_Int8 > ((nuInt32 >> 8 ) & 0xFF);
p4Sequence[2] = static_cast < sal_Int8 > ((nuInt32 >> 16 ) & 0xFF);
p4Sequence[3] = static_cast < sal_Int8 > ((nuInt32 >> 24 ) & 0xFF);
WriteBytes( a4Sequence );
}
}; };
#endif #endif
......
...@@ -58,12 +58,16 @@ public: ...@@ -58,12 +58,16 @@ public:
sal_Int64 SAL_CALL getLength( ) sal_Int64 SAL_CALL getLength( )
throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
ByteGrabber& ReadInt8(sal_Int8& rInt8); sal_uInt16 ReadUInt16();
ByteGrabber& ReadInt16(sal_Int16& rInt16); sal_uInt32 ReadUInt32();
ByteGrabber& ReadInt32(sal_Int32& rInt32); sal_Int16 ReadInt16()
ByteGrabber& ReadUInt8(sal_uInt8& ruInt8); {
ByteGrabber& ReadUInt16(sal_uInt16& ruInt16); return static_cast<sal_Int16>(ReadUInt16());
ByteGrabber& ReadUInt32(sal_uInt32& ruInt32); }
sal_Int32 ReadInt32()
{
return static_cast<sal_Int32>(ReadUInt32());
}
}; };
#endif #endif
......
...@@ -54,51 +54,4 @@ sal_Int64 ByteChucker::GetPosition( ) ...@@ -54,51 +54,4 @@ sal_Int64 ByteChucker::GetPosition( )
return xSeek->getPosition(); return xSeek->getPosition();
} }
ByteChucker& ByteChucker::WriteInt8(sal_Int8 nInt8)
{
p1Sequence[0] = nInt8 & 0xFF;
WriteBytes( a1Sequence );
return *this;
}
ByteChucker& ByteChucker::WriteInt16(sal_Int16 nInt16)
{
p2Sequence[0] = static_cast< sal_Int8 >((nInt16 >> 0 ) & 0xFF);
p2Sequence[1] = static_cast< sal_Int8 >((nInt16 >> 8 ) & 0xFF);
WriteBytes( a2Sequence );
return *this;
}
ByteChucker& ByteChucker::WriteInt32(sal_Int32 nInt32)
{
p4Sequence[0] = static_cast< sal_Int8 >((nInt32 >> 0 ) & 0xFF);
p4Sequence[1] = static_cast< sal_Int8 >((nInt32 >> 8 ) & 0xFF);
p4Sequence[2] = static_cast< sal_Int8 >((nInt32 >> 16 ) & 0xFF);
p4Sequence[3] = static_cast< sal_Int8 >((nInt32 >> 24 ) & 0xFF);
WriteBytes( a4Sequence );
return *this;
}
ByteChucker& ByteChucker::WriteUInt8(sal_uInt8 nuInt8)
{
p1Sequence[0] = nuInt8 & 0xFF;
WriteBytes( a1Sequence );
return *this;
}
ByteChucker& ByteChucker::WriteUInt16(sal_uInt16 nuInt16)
{
p2Sequence[0] = static_cast< sal_Int8 >((nuInt16 >> 0 ) & 0xFF);
p2Sequence[1] = static_cast< sal_Int8 >((nuInt16 >> 8 ) & 0xFF);
WriteBytes( a2Sequence );
return *this;
}
ByteChucker& ByteChucker::WriteUInt32(sal_uInt32 nuInt32)
{
p4Sequence[0] = static_cast < sal_Int8 > ((nuInt32 >> 0 ) & 0xFF);
p4Sequence[1] = static_cast < sal_Int8 > ((nuInt32 >> 8 ) & 0xFF);
p4Sequence[2] = static_cast < sal_Int8 > ((nuInt32 >> 16 ) & 0xFF);
p4Sequence[3] = static_cast < sal_Int8 > ((nuInt32 >> 24 ) & 0xFF);
WriteBytes( a4Sequence );
return *this;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -100,90 +100,32 @@ sal_Int64 SAL_CALL ByteGrabber::getLength( ) ...@@ -100,90 +100,32 @@ sal_Int64 SAL_CALL ByteGrabber::getLength( )
throw io::IOException(THROW_WHERE ); throw io::IOException(THROW_WHERE );
} }
ByteGrabber& ByteGrabber::ReadInt8(sal_Int8& rInt8) sal_uInt16 ByteGrabber::ReadUInt16()
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
if (xStream->readBytes(aSequence,1) != 1)
rInt8 = 0;
else
rInt8 = aSequence[0] & 0xFF;
return *this;
}
ByteGrabber& ByteGrabber::ReadInt16(sal_Int16& rInt16)
{
::osl::MutexGuard aGuard( m_aMutex );
if (xStream->readBytes ( aSequence, 2) != 2)
rInt16 = 0;
else
{
pSequence = aSequence.getConstArray();
rInt16 = static_cast <sal_Int16>
( (pSequence[0] & 0xFF)
| (pSequence[1] & 0xFF) << 8);
}
return *this;
}
ByteGrabber& ByteGrabber::ReadInt32(sal_Int32& rInt32)
{
::osl::MutexGuard aGuard( m_aMutex );
if (xStream->readBytes(aSequence, 4) != 4)
rInt32 = 0;
else
{
pSequence = aSequence.getConstArray();
rInt32 = static_cast < sal_Int32 >
( (pSequence[0] & 0xFF)
| ( pSequence[1] & 0xFF ) << 8
| ( pSequence[2] & 0xFF ) << 16
| ( pSequence[3] & 0xFF ) << 24 );
}
return *this;
}
ByteGrabber& ByteGrabber::ReadUInt8(sal_uInt8& rInt8) if (xStream->readBytes(aSequence, 2) != 2)
{ return 0;
::osl::MutexGuard aGuard( m_aMutex );
if (xStream->readBytes(aSequence,1) != 1) pSequence = aSequence.getConstArray();
rInt8 = 0; return static_cast <sal_uInt16>
else ( (pSequence[0] & 0xFF)
rInt8 = static_cast < sal_uInt8 > (aSequence[0] & 0xFF ); | (pSequence[1] & 0xFF) << 8);
return *this;
} }
ByteGrabber& ByteGrabber::ReadUInt16(sal_uInt16& rInt16)
{
::osl::MutexGuard aGuard( m_aMutex );
if (xStream->readBytes(aSequence, 2) != 2) sal_uInt32 ByteGrabber::ReadUInt32()
rInt16 = 0;
else
{
pSequence = aSequence.getConstArray();
rInt16 = static_cast <sal_uInt16>
( (pSequence[0] & 0xFF)
| (pSequence[1] & 0xFF) << 8);
}
return *this;
}
ByteGrabber& ByteGrabber::ReadUInt32(sal_uInt32& ruInt32)
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
if (xStream->readBytes(aSequence, 4) != 4) if (xStream->readBytes(aSequence, 4) != 4)
ruInt32 = 0; return 0;
else
{ pSequence = aSequence.getConstArray();
pSequence = aSequence.getConstArray(); return static_cast < sal_uInt32 >
ruInt32 = static_cast < sal_uInt32 > ( (pSequence[0] & 0xFF)
( (pSequence[0] & 0xFF) | ( pSequence[1] & 0xFF ) << 8
| ( pSequence[1] & 0xFF ) << 8 | ( pSequence[2] & 0xFF ) << 16
| ( pSequence[2] & 0xFF ) << 16 | ( pSequence[3] & 0xFF ) << 24 );
| ( pSequence[3] & 0xFF ) << 24 );
}
return *this;
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -99,70 +99,57 @@ public: ...@@ -99,70 +99,57 @@ public:
{ {
return mnEnd; return mnEnd;
} }
MemoryByteGrabber& ReadInt8(sal_Int8& rInt8) sal_Int8 ReadInt8()
{ {
if (mnCurrent + 1 > mnEnd ) if (mnCurrent + 1 > mnEnd )
rInt8 = 0; return 0;
else return mpBuffer [mnCurrent++] & 0xFF;
rInt8 = mpBuffer [mnCurrent++] & 0xFF;
return *this;
} }
MemoryByteGrabber& ReadInt16(sal_Int16& rInt16) sal_Int16 ReadInt16()
{ {
if (mnCurrent + 2 > mnEnd ) if (mnCurrent + 2 > mnEnd )
rInt16 = 0; return 0;
else sal_Int16 nInt16 = mpBuffer[mnCurrent++] & 0xFF;
{ nInt16 |= ( mpBuffer[mnCurrent++] & 0xFF ) << 8;
rInt16 = mpBuffer[mnCurrent++] & 0xFF; return nInt16;
rInt16 |= ( mpBuffer[mnCurrent++] & 0xFF ) << 8;
}
return *this;
} }
MemoryByteGrabber& ReadInt32(sal_Int32& rInt32) sal_Int32 ReadInt32()
{ {
if (mnCurrent + 4 > mnEnd ) if (mnCurrent + 4 > mnEnd )
rInt32 = 0; return 0;
else
{ sal_Int32 nInt32 = mpBuffer[mnCurrent++] & 0xFF;
rInt32 = mpBuffer[mnCurrent++] & 0xFF; nInt32 |= ( mpBuffer[mnCurrent++] & 0xFF ) << 8;
rInt32 |= ( mpBuffer[mnCurrent++] & 0xFF ) << 8; nInt32 |= ( mpBuffer[mnCurrent++] & 0xFF ) << 16;
rInt32 |= ( mpBuffer[mnCurrent++] & 0xFF ) << 16; nInt32 |= ( mpBuffer[mnCurrent++] & 0xFF ) << 24;
rInt32 |= ( mpBuffer[mnCurrent++] & 0xFF ) << 24; return nInt32;
}
return *this;
} }
MemoryByteGrabber& ReadUInt8(sal_uInt8& rInt8) sal_uInt8 ReadUInt8()
{ {
if (mnCurrent + 1 > mnEnd ) if (mnCurrent + 1 > mnEnd )
rInt8 = 0; return 0;
else return mpBuffer [mnCurrent++] & 0xFF;
rInt8 = mpBuffer [mnCurrent++] & 0xFF;
return *this;
} }
MemoryByteGrabber& ReadUInt16(sal_uInt16& rInt16) sal_uInt16 ReadUInt16()
{ {
if (mnCurrent + 2 > mnEnd ) if (mnCurrent + 2 > mnEnd )
rInt16 = 0; return 0;
else
{ sal_uInt16 nInt16 = mpBuffer [mnCurrent++] & 0xFF;
rInt16 = mpBuffer [mnCurrent++] & 0xFF; nInt16 |= ( mpBuffer [mnCurrent++] & 0xFF ) << 8;
rInt16 |= ( mpBuffer [mnCurrent++] & 0xFF ) << 8; return nInt16;
}
return *this;
} }
MemoryByteGrabber& ReadUInt32(sal_uInt32& rInt32) sal_uInt32 ReadUInt32()
{ {
if (mnCurrent + 4 > mnEnd ) if (mnCurrent + 4 > mnEnd )
rInt32 = 0; return 0;
else
{ sal_uInt32 nInt32 = mpBuffer [mnCurrent++] & 0xFF;
rInt32 = mpBuffer [mnCurrent++] & 0xFF; nInt32 |= ( mpBuffer [mnCurrent++] & 0xFF ) << 8;
rInt32 |= ( mpBuffer [mnCurrent++] & 0xFF ) << 8; nInt32 |= ( mpBuffer [mnCurrent++] & 0xFF ) << 16;
rInt32 |= ( mpBuffer [mnCurrent++] & 0xFF ) << 16; nInt32 |= ( mpBuffer [mnCurrent++] & 0xFF ) << 24;
rInt32 |= ( mpBuffer [mnCurrent++] & 0xFF ) << 24; return nInt32;
}
return *this;
} }
}; };
......
...@@ -634,24 +634,22 @@ bool ZipFile::readLOC( ZipEntry &rEntry ) ...@@ -634,24 +634,22 @@ bool ZipFile::readLOC( ZipEntry &rEntry )
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
sal_Int32 nTestSig, nTime, nCRC, nSize, nCompressedSize;
sal_Int16 nVersion, nFlag, nHow, nPathLen, nExtraLen;
sal_Int64 nPos = -rEntry.nOffset; sal_Int64 nPos = -rEntry.nOffset;
aGrabber.seek(nPos); aGrabber.seek(nPos);
aGrabber.ReadInt32( nTestSig ); sal_Int32 nTestSig = aGrabber.ReadInt32();
if (nTestSig != LOCSIG) if (nTestSig != LOCSIG)
throw ZipIOException("Invalid LOC header (bad signature)" ); throw ZipIOException("Invalid LOC header (bad signature)" );
aGrabber.ReadInt16( nVersion ); sal_Int16 nVersion = aGrabber.ReadInt16();
aGrabber.ReadInt16( nFlag ); aGrabber.ReadInt16(); //flag
aGrabber.ReadInt16( nHow ); aGrabber.ReadInt16(); //how
aGrabber.ReadInt32( nTime ); aGrabber.ReadInt32(); //time
aGrabber.ReadInt32( nCRC ); aGrabber.ReadInt32(); //crc
aGrabber.ReadInt32( nCompressedSize ); aGrabber.ReadInt32(); //compressed size
aGrabber.ReadInt32( nSize ); aGrabber.ReadInt32(); //size
aGrabber.ReadInt16( nPathLen ); sal_Int16 nPathLen = aGrabber.ReadInt16();
aGrabber.ReadInt16( nExtraLen ); sal_Int16 nExtraLen = aGrabber.ReadInt16();
rEntry.nOffset = aGrabber.getPosition() + nPathLen + nExtraLen; rEntry.nOffset = aGrabber.getPosition() + nPathLen + nExtraLen;
// FIXME64: need to read 64bit LOC // FIXME64: need to read 64bit LOC
...@@ -754,8 +752,8 @@ sal_Int32 ZipFile::readCEN() ...@@ -754,8 +752,8 @@ sal_Int32 ZipFile::readCEN()
throw(IOException, ZipException, RuntimeException) throw(IOException, ZipException, RuntimeException)
{ {
// this method is called in constructor only, no need for mutex // this method is called in constructor only, no need for mutex
sal_Int32 nCenLen, nCenPos = -1, nCenOff, nEndPos, nLocPos; sal_Int32 nCenPos = -1, nEndPos, nLocPos;
sal_uInt16 nCount, nTotal; sal_uInt16 nCount;
try try
{ {
...@@ -763,9 +761,9 @@ sal_Int32 ZipFile::readCEN() ...@@ -763,9 +761,9 @@ sal_Int32 ZipFile::readCEN()
if (nEndPos == -1) if (nEndPos == -1)
return -1; return -1;
aGrabber.seek(nEndPos + ENDTOT); aGrabber.seek(nEndPos + ENDTOT);
aGrabber.ReadUInt16( nTotal ); sal_uInt16 nTotal = aGrabber.ReadUInt16();
aGrabber.ReadInt32( nCenLen ); sal_Int32 nCenLen = aGrabber.ReadInt32();
aGrabber.ReadInt32( nCenOff ); sal_Int32 nCenOff = aGrabber.ReadInt32();
if ( nTotal * CENHDR > nCenLen ) if ( nTotal * CENHDR > nCenLen )
throw ZipException("invalid END header (bad entry count)" ); throw ZipException("invalid END header (bad entry count)" );
...@@ -791,39 +789,36 @@ sal_Int32 ZipFile::readCEN() ...@@ -791,39 +789,36 @@ sal_Int32 ZipFile::readCEN()
MemoryByteGrabber aMemGrabber ( aCENBuffer ); MemoryByteGrabber aMemGrabber ( aCENBuffer );
ZipEntry aEntry; ZipEntry aEntry;
sal_Int32 nTestSig;
sal_Int16 nCommentLen; sal_Int16 nCommentLen;
for (nCount = 0 ; nCount < nTotal; nCount++) for (nCount = 0 ; nCount < nTotal; nCount++)
{ {
aMemGrabber.ReadInt32( nTestSig ); sal_Int32 nTestSig = aMemGrabber.ReadInt32();
if ( nTestSig != CENSIG ) if ( nTestSig != CENSIG )
throw ZipException("Invalid CEN header (bad signature)" ); throw ZipException("Invalid CEN header (bad signature)" );
aMemGrabber.skipBytes ( 2 ); aMemGrabber.skipBytes ( 2 );
aMemGrabber.ReadInt16( aEntry.nVersion ); aEntry.nVersion = aMemGrabber.ReadInt16();
if ( ( aEntry.nVersion & 1 ) == 1 ) if ( ( aEntry.nVersion & 1 ) == 1 )
throw ZipException("Invalid CEN header (encrypted entry)" ); throw ZipException("Invalid CEN header (encrypted entry)" );
aMemGrabber.ReadInt16( aEntry.nFlag ); aEntry.nFlag = aMemGrabber.ReadInt16();
aMemGrabber.ReadInt16( aEntry.nMethod ); aEntry.nMethod = aMemGrabber.ReadInt16();
if ( aEntry.nMethod != STORED && aEntry.nMethod != DEFLATED) if ( aEntry.nMethod != STORED && aEntry.nMethod != DEFLATED)
throw ZipException("Invalid CEN header (bad compression method)" ); throw ZipException("Invalid CEN header (bad compression method)" );
aMemGrabber.ReadInt32( aEntry.nTime ); aEntry.nTime = aMemGrabber.ReadInt32();
aMemGrabber.ReadInt32( aEntry.nCrc ); aEntry.nCrc = aMemGrabber.ReadInt32();
sal_uInt32 nCompressedSize, nSize, nOffset; sal_uInt32 nCompressedSize = aMemGrabber.ReadUInt32();
sal_uInt32 nSize = aMemGrabber.ReadUInt32();
aMemGrabber.ReadUInt32( nCompressedSize ); aEntry.nPathLen = aMemGrabber.ReadInt16();
aMemGrabber.ReadUInt32( nSize ); aEntry.nExtraLen = aMemGrabber.ReadInt16();
aMemGrabber.ReadInt16( aEntry.nPathLen ); nCommentLen = aMemGrabber.ReadInt16();
aMemGrabber.ReadInt16( aEntry.nExtraLen );
aMemGrabber.ReadInt16( nCommentLen );
aMemGrabber.skipBytes ( 8 ); aMemGrabber.skipBytes ( 8 );
aMemGrabber.ReadUInt32( nOffset ); sal_uInt32 nOffset = aMemGrabber.ReadUInt32();
// FIXME64: need to read the 64bit header instead // FIXME64: need to read the 64bit header instead
if ( nSize == 0xffffffff || if ( nSize == 0xffffffff ||
...@@ -905,22 +900,20 @@ sal_Int32 ZipFile::recover() ...@@ -905,22 +900,20 @@ sal_Int32 ZipFile::recover()
ZipEntry aEntry; ZipEntry aEntry;
MemoryByteGrabber aMemGrabber ( Sequence< sal_Int8 >( ((sal_Int8*)(&(pBuffer[nPos+4]))), 26 ) ); MemoryByteGrabber aMemGrabber ( Sequence< sal_Int8 >( ((sal_Int8*)(&(pBuffer[nPos+4]))), 26 ) );
aMemGrabber.ReadInt16( aEntry.nVersion ); aEntry.nVersion = aMemGrabber.ReadInt16();
if ( ( aEntry.nVersion & 1 ) != 1 ) if ( ( aEntry.nVersion & 1 ) != 1 )
{ {
aMemGrabber.ReadInt16( aEntry.nFlag ); aEntry.nFlag = aMemGrabber.ReadInt16();
aMemGrabber.ReadInt16( aEntry.nMethod ); aEntry.nMethod = aMemGrabber.ReadInt16();
if ( aEntry.nMethod == STORED || aEntry.nMethod == DEFLATED ) if ( aEntry.nMethod == STORED || aEntry.nMethod == DEFLATED )
{ {
sal_uInt32 nCompressedSize, nSize; aEntry.nTime = aMemGrabber.ReadInt32();
aEntry.nCrc = aMemGrabber.ReadInt32();
aMemGrabber.ReadInt32( aEntry.nTime ); sal_uInt32 nCompressedSize = aMemGrabber.ReadUInt32();
aMemGrabber.ReadInt32( aEntry.nCrc ); sal_uInt32 nSize = aMemGrabber.ReadUInt32();
aMemGrabber.ReadUInt32( nCompressedSize ); aEntry.nPathLen = aMemGrabber.ReadInt16();
aMemGrabber.ReadUInt32( nSize ); aEntry.nExtraLen = aMemGrabber.ReadInt16();
aMemGrabber.ReadInt16( aEntry.nPathLen );
aMemGrabber.ReadInt16( aEntry.nExtraLen );
// FIXME64: need to read the 64bit header instead // FIXME64: need to read the 64bit header instead
if ( nSize == 0xffffffff || if ( nSize == 0xffffffff ||
...@@ -974,13 +967,11 @@ sal_Int32 ZipFile::recover() ...@@ -974,13 +967,11 @@ sal_Int32 ZipFile::recover()
} }
else if (pBuffer[nPos] == 'P' && pBuffer[nPos+1] == 'K' && pBuffer[nPos+2] == 7 && pBuffer[nPos+3] == 8 ) else if (pBuffer[nPos] == 'P' && pBuffer[nPos+1] == 'K' && pBuffer[nPos+2] == 7 && pBuffer[nPos+3] == 8 )
{ {
sal_Int32 nCRC32;
sal_uInt32 nCompressedSize32, nSize32;
sal_Int64 nCompressedSize, nSize; sal_Int64 nCompressedSize, nSize;
MemoryByteGrabber aMemGrabber ( Sequence< sal_Int8 >( ((sal_Int8*)(&(pBuffer[nPos+4]))), 12 ) ); MemoryByteGrabber aMemGrabber ( Sequence< sal_Int8 >( ((sal_Int8*)(&(pBuffer[nPos+4]))), 12 ) );
aMemGrabber.ReadInt32( nCRC32 ); sal_Int32 nCRC32 = aMemGrabber.ReadInt32();
aMemGrabber.ReadUInt32( nCompressedSize32 ); sal_uInt32 nCompressedSize32 = aMemGrabber.ReadUInt32();
aMemGrabber.ReadUInt32( nSize32 ); sal_uInt32 nSize32 = aMemGrabber.ReadUInt32();
// FIXME64: work to be done here ... // FIXME64: work to be done here ...
nCompressedSize = nCompressedSize32; nCompressedSize = nCompressedSize32;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment