Kaydet (Commit) 2408ca20 authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS geordi2q11 (1.10.94); FILE MERGED

2003/12/16 13:57:12 hr 1.10.94.1: #111934#: join CWS ooo111fix1
üst 44425aa1
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: Deflater.cxx,v $ * $RCSfile: Deflater.cxx,v $
* *
* $Revision: 1.10 $ * $Revision: 1.11 $
* *
* last change: $Author: mtg $ $Date: 2001-11-15 20:16:11 $ * last change: $Author: vg $ $Date: 2003-12-17 18:02:09 $
* *
* 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
...@@ -62,8 +62,12 @@ ...@@ -62,8 +62,12 @@
#include <Deflater.hxx> #include <Deflater.hxx>
#endif #endif
#ifndef _ZLIB_H #ifndef _ZLIB_H
#ifdef SYSTEM_ZLIB
#include <zlib.h>
#else
#include <external/zlib/zlib.h> #include <external/zlib/zlib.h>
#endif #endif
#endif
#ifndef _VOS_DIAGNOSE_H_ #ifndef _VOS_DIAGNOSE_H_
#include <vos/diagnose.hxx> #include <vos/diagnose.hxx>
#endif #endif
...@@ -150,7 +154,11 @@ sal_Int32 Deflater::doDeflateBytes (uno::Sequence < sal_Int8 > &rBuffer, sal_Int ...@@ -150,7 +154,11 @@ sal_Int32 Deflater::doDeflateBytes (uno::Sequence < sal_Int8 > &rBuffer, sal_Int
pStream->avail_in = nLength; pStream->avail_in = nLength;
pStream->avail_out = nNewLength; pStream->avail_out = nNewLength;
#ifdef SYSTEM_ZLIB
nResult = deflateParams(pStream, nLevel, nStrategy);
#else
nResult = z_deflateParams(pStream, nLevel, nStrategy); nResult = z_deflateParams(pStream, nLevel, nStrategy);
#endif
switch (nResult) switch (nResult)
{ {
case Z_OK: case Z_OK:
...@@ -174,7 +182,11 @@ sal_Int32 Deflater::doDeflateBytes (uno::Sequence < sal_Int8 > &rBuffer, sal_Int ...@@ -174,7 +182,11 @@ sal_Int32 Deflater::doDeflateBytes (uno::Sequence < sal_Int8 > &rBuffer, sal_Int
pStream->avail_in = nLength; pStream->avail_in = nLength;
pStream->avail_out = nNewLength; pStream->avail_out = nNewLength;
#ifdef SYSTEM_ZLIB
nResult = deflate(pStream, bFinish ? Z_FINISH : Z_NO_FLUSH);
#else
nResult = z_deflate(pStream, bFinish ? Z_FINISH : Z_NO_FLUSH); nResult = z_deflate(pStream, bFinish ? Z_FINISH : Z_NO_FLUSH);
#endif
switch (nResult) switch (nResult)
{ {
case Z_STREAM_END: case Z_STREAM_END:
...@@ -220,7 +232,11 @@ void SAL_CALL Deflater::setDictionarySegment( const uno::Sequence< sal_Int8 >& r ...@@ -220,7 +232,11 @@ void SAL_CALL Deflater::setDictionarySegment( const uno::Sequence< sal_Int8 >& r
{ {
// do error handling // do error handling
} }
#ifdef SYSTEM_ZLIB
sal_Int32 nResult = deflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray()+nOffset, nLength);
#else
sal_Int32 nResult = z_deflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray()+nOffset, nLength); sal_Int32 nResult = z_deflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray()+nOffset, nLength);
#endif
} }
void SAL_CALL Deflater::setDictionary( const uno::Sequence< sal_Int8 >& rBuffer ) void SAL_CALL Deflater::setDictionary( const uno::Sequence< sal_Int8 >& rBuffer )
{ {
...@@ -230,7 +246,11 @@ void SAL_CALL Deflater::setDictionary( const uno::Sequence< sal_Int8 >& rBuffer ...@@ -230,7 +246,11 @@ void SAL_CALL Deflater::setDictionary( const uno::Sequence< sal_Int8 >& rBuffer
VOS_DEBUG_ONLY("No stream!"); VOS_DEBUG_ONLY("No stream!");
} }
#ifdef SYSTEM_ZLIB
sal_Int32 nResult = deflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray(), rBuffer.getLength());
#else
sal_Int32 nResult = z_deflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray(), rBuffer.getLength()); sal_Int32 nResult = z_deflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray(), rBuffer.getLength());
#endif
} }
void SAL_CALL Deflater::setStrategy( sal_Int32 nNewStrategy ) void SAL_CALL Deflater::setStrategy( sal_Int32 nNewStrategy )
{ {
...@@ -295,7 +315,11 @@ sal_Int32 SAL_CALL Deflater::getTotalOut( ) ...@@ -295,7 +315,11 @@ sal_Int32 SAL_CALL Deflater::getTotalOut( )
} }
void SAL_CALL Deflater::reset( ) void SAL_CALL Deflater::reset( )
{ {
#ifdef SYSTEM_ZLIB
deflateReset(pStream);
#else
z_deflateReset(pStream); z_deflateReset(pStream);
#endif
bFinish = sal_False; bFinish = sal_False;
bFinished = sal_False; bFinished = sal_False;
nOffset = nLength = 0; nOffset = nLength = 0;
...@@ -304,7 +328,11 @@ void SAL_CALL Deflater::end( ) ...@@ -304,7 +328,11 @@ void SAL_CALL Deflater::end( )
{ {
if (pStream != NULL) if (pStream != NULL)
{ {
#ifdef SYSTEM_ZLIB
deflateEnd(pStream);
#else
z_deflateEnd(pStream); z_deflateEnd(pStream);
#endif
delete pStream; delete pStream;
} }
pStream = NULL; pStream = NULL;
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: Inflater.cxx,v $ * $RCSfile: Inflater.cxx,v $
* *
* $Revision: 1.10 $ * $Revision: 1.11 $
* *
* last change: $Author: mtg $ $Date: 2001-11-15 20:17:02 $ * last change: $Author: vg $ $Date: 2003-12-17 18:02:28 $
* *
* 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
...@@ -62,8 +62,12 @@ ...@@ -62,8 +62,12 @@
#include <Inflater.hxx> #include <Inflater.hxx>
#endif #endif
#ifndef _ZLIB_H #ifndef _ZLIB_H
#ifdef SYSTEM_ZLIB
#include <zlib.h>
#else
#include <external/zlib/zlib.h> #include <external/zlib/zlib.h>
#endif #endif
#endif
#ifndef _VOS_DIAGNOSE_H_ #ifndef _VOS_DIAGNOSE_H_
#include <vos/diagnose.hxx> #include <vos/diagnose.hxx>
#endif #endif
...@@ -133,8 +137,13 @@ void SAL_CALL Inflater::setDictionarySegment( const Sequence< sal_Int8 >& rBuffe ...@@ -133,8 +137,13 @@ void SAL_CALL Inflater::setDictionarySegment( const Sequence< sal_Int8 >& rBuffe
{ {
// do error handling // do error handling
} }
#ifdef SYSTEM_ZLIB
inflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray() + nNewOffset,
nNewLength);
#else
z_inflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray() + nNewOffset, z_inflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray() + nNewOffset,
nNewLength); nNewLength);
#endif
} }
void SAL_CALL Inflater::setDictionary( const Sequence< sal_Int8 >& rBuffer ) void SAL_CALL Inflater::setDictionary( const Sequence< sal_Int8 >& rBuffer )
...@@ -143,8 +152,13 @@ void SAL_CALL Inflater::setDictionary( const Sequence< sal_Int8 >& rBuffer ) ...@@ -143,8 +152,13 @@ void SAL_CALL Inflater::setDictionary( const Sequence< sal_Int8 >& rBuffer )
{ {
// do error handling // do error handling
} }
#ifdef SYSTEM_ZLIB
inflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray(),
rBuffer.getLength());
#else
z_inflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray(), z_inflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray(),
rBuffer.getLength()); rBuffer.getLength());
#endif
} }
sal_Int32 SAL_CALL Inflater::getRemaining( ) sal_Int32 SAL_CALL Inflater::getRemaining( )
...@@ -202,7 +216,11 @@ sal_Int32 SAL_CALL Inflater::getTotalOut( ) ...@@ -202,7 +216,11 @@ sal_Int32 SAL_CALL Inflater::getTotalOut( )
void SAL_CALL Inflater::reset( ) void SAL_CALL Inflater::reset( )
{ {
#ifdef SYSTEM_ZLIB
inflateReset(pStream);
#else
z_inflateReset(pStream); z_inflateReset(pStream);
#endif
bFinish = bNeedDict = bFinished = sal_False; bFinish = bNeedDict = bFinished = sal_False;
nOffset = nLength = 0; nOffset = nLength = 0;
} }
...@@ -211,7 +229,11 @@ void SAL_CALL Inflater::end( ) ...@@ -211,7 +229,11 @@ void SAL_CALL Inflater::end( )
{ {
if (pStream != NULL) if (pStream != NULL)
{ {
#ifdef SYSTEM_ZLIB
inflateEnd(pStream);
#else
z_inflateEnd(pStream); z_inflateEnd(pStream);
#endif
delete pStream; delete pStream;
} }
pStream = NULL; pStream = NULL;
...@@ -225,7 +247,11 @@ sal_Int32 Inflater::doInflateBytes (Sequence < sal_Int8 > &rBuffer, sal_Int32 n ...@@ -225,7 +247,11 @@ sal_Int32 Inflater::doInflateBytes (Sequence < sal_Int8 > &rBuffer, sal_Int32 n
pStream->next_out = reinterpret_cast < unsigned char* > ( rBuffer.getArray() + nNewOffset ); pStream->next_out = reinterpret_cast < unsigned char* > ( rBuffer.getArray() + nNewOffset );
pStream->avail_out = nNewLength; pStream->avail_out = nNewLength;
#ifdef SYSTEM_ZLIB
nResult = ::inflate(pStream, bFinish ? Z_SYNC_FLUSH : Z_PARTIAL_FLUSH);
#else
nResult = ::z_inflate(pStream, bFinish ? Z_SYNC_FLUSH : Z_PARTIAL_FLUSH); nResult = ::z_inflate(pStream, bFinish ? Z_SYNC_FLUSH : Z_PARTIAL_FLUSH);
#endif
switch (nResult) switch (nResult)
{ {
......
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