#80556# fix compiler warnings
This commit is contained in:
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ByteChucker.cxx,v $
|
* $RCSfile: ByteChucker.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.4 $
|
* $Revision: 1.5 $
|
||||||
*
|
*
|
||||||
* last change: $Author: mtg $ $Date: 2000-11-29 13:47:17 $
|
* last change: $Author: mtg $ $Date: 2000-12-01 10:49:47 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -102,7 +102,7 @@ sal_Int64 SAL_CALL ByteChucker::seek( sal_Int64 location )
|
|||||||
{
|
{
|
||||||
if (xSeek.is() )
|
if (xSeek.is() )
|
||||||
{
|
{
|
||||||
sal_Int32 nLen = xSeek->getLength();
|
sal_Int64 nLen = xSeek->getLength();
|
||||||
if (location > nLen )
|
if (location > nLen )
|
||||||
location = nLen;
|
location = nLen;
|
||||||
xSeek->seek( location );
|
xSeek->seek( location );
|
||||||
@@ -172,10 +172,10 @@ ByteChucker& ByteChucker::operator << (sal_uInt16 nuInt16)
|
|||||||
ByteChucker& ByteChucker::operator << (sal_uInt32 nuInt32)
|
ByteChucker& ByteChucker::operator << (sal_uInt32 nuInt32)
|
||||||
{
|
{
|
||||||
uno::Sequence< sal_Int8 > aSequence (4);
|
uno::Sequence< sal_Int8 > aSequence (4);
|
||||||
aSequence[0] = (nuInt32 >> 0 ) & 0xFF;
|
aSequence[0] = static_cast < sal_Int8 > (nuInt32 >> 0 ) & 0xFF;
|
||||||
aSequence[1] = (nuInt32 >> 8 ) & 0xFF;
|
aSequence[1] = static_cast < sal_Int8 > (nuInt32 >> 8 ) & 0xFF;
|
||||||
aSequence[2] = (nuInt32 >> 16 ) & 0xFF;
|
aSequence[2] = static_cast < sal_Int8 > (nuInt32 >> 16 ) & 0xFF;
|
||||||
aSequence[3] = (nuInt32 >> 24 ) & 0xFF;
|
aSequence[3] = static_cast < sal_Int8 > (nuInt32 >> 24 ) & 0xFF;
|
||||||
xStream->writeBytes(aSequence);
|
xStream->writeBytes(aSequence);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ByteGrabber.cxx,v $
|
* $RCSfile: ByteGrabber.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.3 $
|
* $Revision: 1.4 $
|
||||||
*
|
*
|
||||||
* last change: $Author: mtg $ $Date: 2000-11-29 13:47:17 $
|
* last change: $Author: mtg $ $Date: 2000-12-01 10:49:47 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -114,7 +114,7 @@ sal_Int64 SAL_CALL ByteGrabber::seek( sal_Int64 location )
|
|||||||
{
|
{
|
||||||
if (xSeek.is() )
|
if (xSeek.is() )
|
||||||
{
|
{
|
||||||
sal_Int32 nLen = xSeek->getLength();
|
sal_Int64 nLen = xSeek->getLength();
|
||||||
if (location > nLen )
|
if (location > nLen )
|
||||||
location = nLen;
|
location = nLen;
|
||||||
xSeek->seek( location );
|
xSeek->seek( location );
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: EntryInputStream.cxx,v $
|
* $RCSfile: EntryInputStream.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.4 $
|
* $Revision: 1.5 $
|
||||||
*
|
*
|
||||||
* last change: $Author: mba $ $Date: 2000-11-30 13:47:49 $
|
* last change: $Author: mtg $ $Date: 2000-12-01 10:49:47 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -85,10 +85,10 @@ EntryInputStream::EntryInputStream( uno::Reference < io::XInputStream > xNewInpu
|
|||||||
, nBegin( 0 )
|
, nBegin( 0 )
|
||||||
, nCurrent( 0 )
|
, nCurrent( 0 )
|
||||||
, nEnd(nUncompressedSize)
|
, nEnd(nUncompressedSize)
|
||||||
, aSequence ( nNewEnd - nNewBegin )
|
, aSequence ( static_cast < sal_Int32 > (nNewEnd - nNewBegin) )
|
||||||
, bReachEOF ( sal_False )
|
, bReachEOF ( sal_False )
|
||||||
, aInflater( sal_True )
|
, aInflater( sal_True )
|
||||||
, aBuffer( nUncompressedSize )
|
, aBuffer( static_cast < sal_Int32 > (nUncompressedSize) )
|
||||||
{
|
{
|
||||||
if (nCompEnd - nCompBegin < nUncompressedSize)
|
if (nCompEnd - nCompBegin < nUncompressedSize)
|
||||||
bDeflated = sal_True;
|
bDeflated = sal_True;
|
||||||
@@ -97,14 +97,14 @@ EntryInputStream::EntryInputStream( uno::Reference < io::XInputStream > xNewInpu
|
|||||||
if (bDeflated)
|
if (bDeflated)
|
||||||
{
|
{
|
||||||
xSeek->seek(nNewBegin);
|
xSeek->seek(nNewBegin);
|
||||||
xStream->readBytes(aSequence, nNewEnd - nNewBegin);
|
xStream->readBytes(aSequence, static_cast < sal_Int32 > (nNewEnd - nNewBegin));
|
||||||
aInflater.setInputSegment(aSequence, 0, nNewEnd - nNewBegin );
|
aInflater.setInputSegment(aSequence, 0, static_cast < sal_Int32 > (nNewEnd - nNewBegin) );
|
||||||
aInflater.doInflate(aBuffer);
|
aInflater.doInflate(aBuffer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xSeek->seek(nNewBegin);
|
xSeek->seek(nNewBegin);
|
||||||
xStream->readBytes(aBuffer, nUncompressedSize);
|
xStream->readBytes(aBuffer, static_cast < sal_Int32 > (nUncompressedSize));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,15 +113,15 @@ EntryInputStream::~EntryInputStream( void )
|
|||||||
}
|
}
|
||||||
void EntryInputStream::fill(void)
|
void EntryInputStream::fill(void)
|
||||||
{
|
{
|
||||||
sal_Int32 nLength, nBytesToRead = aSequence.getLength();
|
sal_Int64 nLength, nBytesToRead = aSequence.getLength();
|
||||||
if (nBytesToRead + nCompCurrent> nCompEnd)
|
if (nBytesToRead + nCompCurrent> nCompEnd)
|
||||||
nBytesToRead = nCompEnd - nCompCurrent;
|
nBytesToRead = nCompEnd - nCompCurrent;
|
||||||
if (xSeek.is())
|
if (xSeek.is())
|
||||||
xSeek->seek( nCompCurrent );
|
xSeek->seek( nCompCurrent );
|
||||||
else
|
else
|
||||||
throw (io::IOException());
|
throw (io::IOException());
|
||||||
nLength = xStream->readBytes(aSequence, nBytesToRead);
|
nLength = xStream->readBytes(aSequence, static_cast < sal_Int32> (nBytesToRead));
|
||||||
aInflater.setInputSegment(aSequence, 0, nLength);
|
aInflater.setInputSegment(aSequence, 0, static_cast < sal_Int32> (nLength));
|
||||||
}
|
}
|
||||||
sal_Int32 SAL_CALL EntryInputStream::readBytes( uno::Sequence< sal_Int8 >& aData,
|
sal_Int32 SAL_CALL EntryInputStream::readBytes( uno::Sequence< sal_Int8 >& aData,
|
||||||
sal_Int32 nBytesToRead )
|
sal_Int32 nBytesToRead )
|
||||||
@@ -134,14 +134,13 @@ sal_Int32 SAL_CALL EntryInputStream::readBytes( uno::Sequence< sal_Int8 >& aData
|
|||||||
{
|
{
|
||||||
if (nCurrent > nEnd)
|
if (nCurrent > nEnd)
|
||||||
return 0;
|
return 0;
|
||||||
nBytesToRead = nEnd - nCurrent;
|
nBytesToRead = static_cast < sal_Int32> (nEnd - nCurrent);
|
||||||
}
|
}
|
||||||
|
|
||||||
aData.realloc( nBytesToRead );
|
aData.realloc( nBytesToRead );
|
||||||
sal_Int64 nDataLen = aData.getLength();
|
|
||||||
|
|
||||||
for ( sal_Int64 i = 0; i< nBytesToRead;i++,nCurrent++)
|
for ( sal_Int32 i = 0; i< nBytesToRead;i++,nCurrent++)
|
||||||
aData[i] = aBuffer[nCurrent];
|
aData[i] = aBuffer[static_cast < sal_Int32 > (nCurrent)];
|
||||||
|
|
||||||
return nBytesToRead;
|
return nBytesToRead;
|
||||||
/*
|
/*
|
||||||
@@ -193,7 +192,7 @@ void SAL_CALL EntryInputStream::skipBytes( sal_Int32 nBytesToSkip )
|
|||||||
if (nBytesToSkip == 0)
|
if (nBytesToSkip == 0)
|
||||||
return;
|
return;
|
||||||
if (nBytesToSkip + nCurrent > nEnd )
|
if (nBytesToSkip + nCurrent > nEnd )
|
||||||
nBytesToSkip = nEnd - nCurrent;
|
nBytesToSkip = static_cast < sal_Int32 > (nEnd - nCurrent);
|
||||||
|
|
||||||
nCurrent+=nBytesToSkip;
|
nCurrent+=nBytesToSkip;
|
||||||
/*
|
/*
|
||||||
@@ -231,7 +230,7 @@ void SAL_CALL EntryInputStream::skipBytes( sal_Int32 nBytesToSkip )
|
|||||||
sal_Int32 SAL_CALL EntryInputStream::available( )
|
sal_Int32 SAL_CALL EntryInputStream::available( )
|
||||||
throw(io::NotConnectedException, io::IOException, uno::RuntimeException)
|
throw(io::NotConnectedException, io::IOException, uno::RuntimeException)
|
||||||
{
|
{
|
||||||
return aBuffer.getLength() - nCurrent;
|
return aBuffer.getLength() - static_cast < sal_Int32> (nCurrent);
|
||||||
/*
|
/*
|
||||||
if (!bDeflated)
|
if (!bDeflated)
|
||||||
return nCompEnd - nCompCurrent;
|
return nCompEnd - nCompCurrent;
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ZipFile.cxx,v $
|
* $RCSfile: ZipFile.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.8 $
|
* $Revision: 1.9 $
|
||||||
*
|
*
|
||||||
* last change: $Author: mtg $ $Date: 2000-11-29 13:47:17 $
|
* last change: $Author: mtg $ $Date: 2000-12-01 10:49:47 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -221,7 +221,7 @@ sal_Bool ZipFile::readLOC(const package::ZipEntry &rEntry)
|
|||||||
aGrabber >> nNameLen;
|
aGrabber >> nNameLen;
|
||||||
aGrabber >> nExtraLen;
|
aGrabber >> nExtraLen;
|
||||||
package::ZipEntry *pNonConstEntry = const_cast < package::ZipEntry* > (&rEntry);
|
package::ZipEntry *pNonConstEntry = const_cast < package::ZipEntry* > (&rEntry);
|
||||||
pNonConstEntry->nOffset = aGrabber.getPosition() + nNameLen + nExtraLen;
|
pNonConstEntry->nOffset = static_cast < sal_Int8 > (aGrabber.getPosition()) + nNameLen + nExtraLen;
|
||||||
return sal_True;
|
return sal_True;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -251,9 +251,9 @@ sal_Bool ZipFile::readLOC(const package::ZipEntry &rEntry)
|
|||||||
|
|
||||||
sal_Int32 ZipFile::findEND( )
|
sal_Int32 ZipFile::findEND( )
|
||||||
{
|
{
|
||||||
sal_uInt32 nLength=0, nPos=0;
|
sal_Int32 nLength=0, nPos=0;
|
||||||
uno::Sequence < sal_Int8 > aByteSeq;
|
uno::Sequence < sal_Int8 > aByteSeq;
|
||||||
nLength = nPos = aGrabber.getLength();
|
nLength = nPos = static_cast <sal_Int32 > (aGrabber.getLength());
|
||||||
if (nLength == 0)
|
if (nLength == 0)
|
||||||
return -1;
|
return -1;
|
||||||
aGrabber.seek( nLength );
|
aGrabber.seek( nLength );
|
||||||
@@ -273,7 +273,7 @@ sal_Int32 ZipFile::findEND( )
|
|||||||
if (nTest == ENDSIG)
|
if (nTest == ENDSIG)
|
||||||
{
|
{
|
||||||
sal_uInt16 nCommentLength;
|
sal_uInt16 nCommentLength;
|
||||||
sal_uInt32 nEndPos = nPos + i;
|
sal_Int32 nEndPos = nPos + i;
|
||||||
aGrabber.seek(nEndPos+ENDCOM);
|
aGrabber.seek(nEndPos+ENDCOM);
|
||||||
aGrabber >> nCommentLength;
|
aGrabber >> nCommentLength;
|
||||||
if (nEndPos + ENDHDR + nCommentLength == nLength)
|
if (nEndPos + ENDHDR + nCommentLength == nLength)
|
||||||
@@ -319,9 +319,9 @@ void ZipFile::addEntryComment( int nIndex, ByteSequence &rComment)
|
|||||||
|
|
||||||
sal_Int32 ZipFile::readCEN()
|
sal_Int32 ZipFile::readCEN()
|
||||||
{
|
{
|
||||||
sal_uInt32 nEndPos, nLocPos;
|
sal_Int32 nEndPos, nLocPos;
|
||||||
sal_Int16 nCount, nTotal;
|
sal_Int16 nCount, nTotal;
|
||||||
sal_uInt32 nCenLen, nCenPos, nCenOff;
|
sal_Int32 nCenLen, nCenPos, nCenOff;
|
||||||
|
|
||||||
nEndPos = findEND();
|
nEndPos = findEND();
|
||||||
if (nEndPos == -1)
|
if (nEndPos == -1)
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ZipOutputStream.cxx,v $
|
* $RCSfile: ZipOutputStream.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.10 $
|
* $Revision: 1.11 $
|
||||||
*
|
*
|
||||||
* last change: $Author: mtg $ $Date: 2000-11-29 03:14:55 $
|
* last change: $Author: mtg $ $Date: 2000-12-01 10:49:47 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -91,7 +91,7 @@ void SAL_CALL ZipOutputStream::setComment( const ::rtl::OUString& rComment )
|
|||||||
void SAL_CALL ZipOutputStream::setMethod( sal_Int32 nNewMethod )
|
void SAL_CALL ZipOutputStream::setMethod( sal_Int32 nNewMethod )
|
||||||
throw(uno::RuntimeException)
|
throw(uno::RuntimeException)
|
||||||
{
|
{
|
||||||
nMethod = nNewMethod;
|
nMethod = static_cast < sal_Int16 > (nNewMethod);
|
||||||
}
|
}
|
||||||
void SAL_CALL ZipOutputStream::setLevel( sal_Int32 nNewLevel )
|
void SAL_CALL ZipOutputStream::setLevel( sal_Int32 nNewLevel )
|
||||||
throw(uno::RuntimeException)
|
throw(uno::RuntimeException)
|
||||||
@@ -121,7 +121,7 @@ void SAL_CALL ZipOutputStream::putNextEntry( const package::ZipEntry& rEntry )
|
|||||||
pNonConstEntry->nCrc != -1)
|
pNonConstEntry->nCrc != -1)
|
||||||
pNonConstEntry->nFlag = 0;
|
pNonConstEntry->nFlag = 0;
|
||||||
|
|
||||||
pNonConstEntry->nOffset = aChucker.getPosition();
|
pNonConstEntry->nOffset = static_cast < sal_Int32 > (aChucker.getPosition());
|
||||||
writeLOC(rEntry);
|
writeLOC(rEntry);
|
||||||
aZipList.push_back(pNonConstEntry);
|
aZipList.push_back(pNonConstEntry);
|
||||||
pCurrentEntry=pNonConstEntry;
|
pCurrentEntry=pNonConstEntry;
|
||||||
@@ -229,10 +229,10 @@ void SAL_CALL ZipOutputStream::finish( )
|
|||||||
// boom
|
// boom
|
||||||
VOS_DEBUG_ONLY("Zip file must have at least one entry!\n");
|
VOS_DEBUG_ONLY("Zip file must have at least one entry!\n");
|
||||||
}
|
}
|
||||||
sal_Int32 nOffset= aChucker.getPosition();
|
sal_Int32 nOffset= static_cast < sal_Int32 > (aChucker.getPosition());
|
||||||
for (int i =0, nEnd = aZipList.size(); i < nEnd; i++)
|
for (int i =0, nEnd = aZipList.size(); i < nEnd; i++)
|
||||||
writeCEN(*aZipList[i]);
|
writeCEN(*aZipList[i]);
|
||||||
writeEND( nOffset, aChucker.getPosition() - nOffset);
|
writeEND( nOffset, static_cast < sal_Int32 > (aChucker.getPosition()) - nOffset);
|
||||||
bFinished = sal_True;
|
bFinished = sal_True;
|
||||||
}
|
}
|
||||||
void ZipOutputStream::doDeflate()
|
void ZipOutputStream::doDeflate()
|
||||||
@@ -250,7 +250,7 @@ void ZipOutputStream::doDeflate()
|
|||||||
}
|
}
|
||||||
void ZipOutputStream::writeEND(sal_uInt32 nOffset, sal_uInt32 nLength)
|
void ZipOutputStream::writeEND(sal_uInt32 nOffset, sal_uInt32 nLength)
|
||||||
{
|
{
|
||||||
sal_Int16 i=0, nCommentLength = sComment.getLength();
|
sal_Int16 i=0, nCommentLength = static_cast < sal_Int16 > (sComment.getLength());
|
||||||
const sal_Unicode *pChar = sComment.getStr();
|
const sal_Unicode *pChar = sComment.getStr();
|
||||||
uno::Sequence < sal_Int8 > aSequence (nCommentLength);
|
uno::Sequence < sal_Int8 > aSequence (nCommentLength);
|
||||||
for ( ; i < nCommentLength; i++)
|
for ( ; i < nCommentLength; i++)
|
||||||
@@ -271,9 +271,10 @@ void ZipOutputStream::writeEND(sal_uInt32 nOffset, sal_uInt32 nLength)
|
|||||||
}
|
}
|
||||||
void ZipOutputStream::writeCEN( const package::ZipEntry &rEntry )
|
void ZipOutputStream::writeCEN( const package::ZipEntry &rEntry )
|
||||||
{
|
{
|
||||||
sal_Int16 nNameLength = rEntry.sName.getLength(),
|
sal_Int16 nNameLength = static_cast < sal_Int16 > ( rEntry.sName.getLength() ) ,
|
||||||
nCommentLength = rEntry.sComment.getLength(),
|
nCommentLength = static_cast < sal_Int16 > ( rEntry.sComment.getLength() ) ,
|
||||||
nExtraLength = rEntry.extra.getLength(), i = 0;
|
nExtraLength = static_cast < sal_Int16 > ( rEntry.extra.getLength() );
|
||||||
|
sal_Int16 i = 0;
|
||||||
|
|
||||||
aChucker << CENSIG;
|
aChucker << CENSIG;
|
||||||
aChucker << rEntry.nVersion;
|
aChucker << rEntry.nVersion;
|
||||||
@@ -331,7 +332,8 @@ void ZipOutputStream::writeEXT( const package::ZipEntry &rEntry )
|
|||||||
|
|
||||||
void ZipOutputStream::writeLOC( const package::ZipEntry &rEntry )
|
void ZipOutputStream::writeLOC( const package::ZipEntry &rEntry )
|
||||||
{
|
{
|
||||||
sal_Int16 nNameLength = rEntry.sName.getLength(), i=0;
|
sal_Int16 nNameLength = static_cast < sal_Int16 > (rEntry.sName.getLength());
|
||||||
|
sal_Int16 i=0;
|
||||||
aChucker << LOCSIG;
|
aChucker << LOCSIG;
|
||||||
aChucker << rEntry.nVersion;
|
aChucker << rEntry.nVersion;
|
||||||
aChucker << rEntry.nFlag;
|
aChucker << rEntry.nFlag;
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ZipPackage.cxx,v $
|
* $RCSfile: ZipPackage.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.19 $
|
* $Revision: 1.20 $
|
||||||
*
|
*
|
||||||
* last change: $Author: mtg $ $Date: 2000-11-29 13:47:18 $
|
* last change: $Author: mtg $ $Date: 2000-12-01 10:50:49 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -468,14 +468,14 @@ void SAL_CALL ZipPackage::commitChanges( )
|
|||||||
|
|
||||||
ManifestWriter aWriter ( xManOutStream, xFactory, aManList);
|
ManifestWriter aWriter ( xManOutStream, xFactory, aManList);
|
||||||
aWriter.Write();
|
aWriter.Write();
|
||||||
pManifestStream->aEntry.nSize = pManifestStream->aEntry.nCompressedSize = pBuffer->getPosition();
|
pManifestStream->aEntry.nSize = pManifestStream->aEntry.nCompressedSize = static_cast < sal_Int32 > (pBuffer->getPosition());
|
||||||
pBuffer->aBuffer.realloc(pBuffer->getPosition());
|
pBuffer->aBuffer.realloc(static_cast < sal_Int32 > (pBuffer->getPosition()));
|
||||||
CRC32 aCRC;
|
CRC32 aCRC;
|
||||||
aCRC.update(pBuffer->aBuffer);
|
aCRC.update(pBuffer->aBuffer);
|
||||||
pManifestStream->aEntry.nCrc = aCRC.getValue();
|
pManifestStream->aEntry.nCrc = aCRC.getValue();
|
||||||
|
|
||||||
pZipOut->putNextEntry(pManifestStream->aEntry);
|
pZipOut->putNextEntry(pManifestStream->aEntry);
|
||||||
pZipOut->write(pBuffer->aBuffer, 0, pBuffer->getPosition());
|
pZipOut->write(pBuffer->aBuffer, 0, static_cast < sal_Int32 > (pBuffer->getPosition()));
|
||||||
pZipOut->closeEntry();
|
pZipOut->closeEntry();
|
||||||
|
|
||||||
pZipOut->finish();
|
pZipOut->finish();
|
||||||
@@ -485,7 +485,7 @@ void SAL_CALL ZipPackage::commitChanges( )
|
|||||||
xMetaFolder->insertByName(OUString::createFromAscii("manifest.xml"), aAny);
|
xMetaFolder->insertByName(OUString::createFromAscii("manifest.xml"), aAny);
|
||||||
|
|
||||||
pZipFile->updateFromManList( aManList );
|
pZipFile->updateFromManList( aManList );
|
||||||
for (sal_Int32 i=0 ; i < aManList.size(); i++)
|
for (sal_uInt32 i=0 ; i < aManList.size(); i++)
|
||||||
{
|
{
|
||||||
ZipEntry * pEntry = aManList[i]->pEntry;
|
ZipEntry * pEntry = aManList[i]->pEntry;
|
||||||
pEntry->sName = aManList[i]->sShortName;
|
pEntry->sName = aManList[i]->sShortName;
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ZipPackageBuffer.cxx,v $
|
* $RCSfile: ZipPackageBuffer.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.4 $
|
* $Revision: 1.5 $
|
||||||
*
|
*
|
||||||
* last change: $Author: mtg $ $Date: 2000-11-27 16:55:07 $
|
* last change: $Author: mtg $ $Date: 2000-12-01 10:50:49 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -67,7 +67,7 @@ using namespace com::sun::star::io;
|
|||||||
|
|
||||||
ZipPackageBuffer::ZipPackageBuffer(sal_Int64 nNewBufferSize)
|
ZipPackageBuffer::ZipPackageBuffer(sal_Int64 nNewBufferSize)
|
||||||
: nBufferSize (nNewBufferSize)
|
: nBufferSize (nNewBufferSize)
|
||||||
, aBuffer (nNewBufferSize)
|
, aBuffer (static_cast < sal_Int32 > (nNewBufferSize))
|
||||||
, nCurrent(0)
|
, nCurrent(0)
|
||||||
, nEnd(0)
|
, nEnd(0)
|
||||||
{
|
{
|
||||||
@@ -101,11 +101,11 @@ sal_Int32 SAL_CALL ZipPackageBuffer::readBytes( Sequence< sal_Int8 >& aData, sal
|
|||||||
throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException)
|
throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException)
|
||||||
{
|
{
|
||||||
if (nBytesToRead + nCurrent > nEnd)
|
if (nBytesToRead + nCurrent > nEnd)
|
||||||
nBytesToRead = nEnd - nCurrent;
|
nBytesToRead = static_cast < sal_Int32 > (nEnd - nCurrent);
|
||||||
sal_Int64 nEndRead = nBytesToRead+nCurrent;
|
sal_Int64 nEndRead = nBytesToRead+nCurrent;
|
||||||
|
|
||||||
for (sal_Int64 i =0; nCurrent < nEndRead; nCurrent++, i++)
|
for (sal_Int32 i =0; nCurrent < nEndRead; nCurrent++, i++)
|
||||||
aData[i] = aBuffer[nCurrent];
|
aData[i] = aBuffer[static_cast < sal_Int32 > (nCurrent)];
|
||||||
return nBytesToRead;
|
return nBytesToRead;
|
||||||
}
|
}
|
||||||
sal_Int32 SAL_CALL ZipPackageBuffer::readSomeBytes( Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead )
|
sal_Int32 SAL_CALL ZipPackageBuffer::readSomeBytes( Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead )
|
||||||
@@ -130,7 +130,7 @@ void SAL_CALL ZipPackageBuffer::skipBytes( sal_Int32 nBytesToSkip )
|
|||||||
sal_Int32 SAL_CALL ZipPackageBuffer::available( )
|
sal_Int32 SAL_CALL ZipPackageBuffer::available( )
|
||||||
throw(NotConnectedException, IOException, RuntimeException)
|
throw(NotConnectedException, IOException, RuntimeException)
|
||||||
{
|
{
|
||||||
return nEnd - nCurrent;
|
return static_cast < sal_Int32 > (nEnd - nCurrent);
|
||||||
}
|
}
|
||||||
void SAL_CALL ZipPackageBuffer::closeInput( )
|
void SAL_CALL ZipPackageBuffer::closeInput( )
|
||||||
throw(NotConnectedException, IOException, RuntimeException)
|
throw(NotConnectedException, IOException, RuntimeException)
|
||||||
@@ -143,10 +143,10 @@ void SAL_CALL ZipPackageBuffer::writeBytes( const Sequence< sal_Int8 >& aData )
|
|||||||
if (nEnd + nDataLen > nBufferSize)
|
if (nEnd + nDataLen > nBufferSize)
|
||||||
{
|
{
|
||||||
nBufferSize *=2;
|
nBufferSize *=2;
|
||||||
aBuffer.realloc(nBufferSize);
|
aBuffer.realloc(static_cast < sal_Int32 > (nBufferSize));
|
||||||
}
|
}
|
||||||
for (sal_Int64 i=0; i<nDataLen;i++,nCurrent++)
|
for (sal_Int32 i=0; i<nDataLen;i++,nCurrent++)
|
||||||
aBuffer[nCurrent] = aData[i];
|
aBuffer[static_cast < sal_Int32 > (nCurrent) ] = aData[i];
|
||||||
if (nCurrent>nEnd)
|
if (nCurrent>nEnd)
|
||||||
nEnd = nCurrent;
|
nEnd = nCurrent;
|
||||||
}
|
}
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
*
|
*
|
||||||
* $RCSfile: ZipPackageFolder.cxx,v $
|
* $RCSfile: ZipPackageFolder.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.15 $
|
* $Revision: 1.16 $
|
||||||
*
|
*
|
||||||
* last change: $Author: mtg $ $Date: 2000-11-29 14:09:05 $
|
* last change: $Author: mtg $ $Date: 2000-12-01 10:50:49 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to the terms of
|
* The Contents of this file are made available subject to the terms of
|
||||||
* either of the following licenses
|
* either of the following licenses
|
||||||
@@ -332,7 +332,7 @@ void ZipPackageFolder::saveContents(rtl::OUString &rPath, std::vector < Manifest
|
|||||||
xSeek->seek(0);
|
xSeek->seek(0);
|
||||||
if (pStream->aEntry.nMethod == STORED)
|
if (pStream->aEntry.nMethod == STORED)
|
||||||
{
|
{
|
||||||
pStream->aEntry.nSize = pStream->aEntry.nCompressedSize = xSeek->getLength();
|
pStream->aEntry.nSize = pStream->aEntry.nCompressedSize = static_cast < sal_Int32 > (xSeek->getLength());
|
||||||
bTrackLength = sal_False;
|
bTrackLength = sal_False;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -341,7 +341,7 @@ void ZipPackageFolder::saveContents(rtl::OUString &rPath, std::vector < Manifest
|
|||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
uno::Sequence < sal_Int8 > aSeq (65535);
|
uno::Sequence < sal_Int8 > aSeq (65535);
|
||||||
sal_Int64 nLength;
|
sal_Int32 nLength;
|
||||||
nLength = xStream->readBytes(aSeq, 65535);
|
nLength = xStream->readBytes(aSeq, 65535);
|
||||||
if (nLength < 65535)
|
if (nLength < 65535)
|
||||||
aSeq.realloc(nLength);
|
aSeq.realloc(nLength);
|
||||||
|
Reference in New Issue
Block a user