diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2003-12-17 17:02:28 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2003-12-17 17:02:28 +0000 |
commit | bd838f3e098a078d91b5c822fb3b199356df346b (patch) | |
tree | cc6ecae20ac3dc9c10540575ecda771ac8c1f249 /package/source/zipapi/Inflater.cxx | |
parent | 69bc9baf26682446fb49fa858bd2679f31361e1e (diff) |
INTEGRATION: CWS geordi2q11 (1.10.94); FILE MERGED
2003/12/16 13:57:12 hr 1.10.94.1: #111934#: join CWS ooo111fix1
Diffstat (limited to 'package/source/zipapi/Inflater.cxx')
-rw-r--r-- | package/source/zipapi/Inflater.cxx | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/package/source/zipapi/Inflater.cxx b/package/source/zipapi/Inflater.cxx index f4d23c317..72e03812b 100644 --- a/package/source/zipapi/Inflater.cxx +++ b/package/source/zipapi/Inflater.cxx @@ -2,9 +2,9 @@ * * $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 * either of the following licenses @@ -62,8 +62,12 @@ #include <Inflater.hxx> #endif #ifndef _ZLIB_H +#ifdef SYSTEM_ZLIB +#include <zlib.h> +#else #include <external/zlib/zlib.h> #endif +#endif #ifndef _VOS_DIAGNOSE_H_ #include <vos/diagnose.hxx> #endif @@ -133,8 +137,13 @@ void SAL_CALL Inflater::setDictionarySegment( const Sequence< sal_Int8 >& rBuffe { // 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, nNewLength); +#endif } 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 } +#ifdef SYSTEM_ZLIB + inflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray(), + rBuffer.getLength()); +#else z_inflateSetDictionary(pStream, (const unsigned char*)rBuffer.getConstArray(), rBuffer.getLength()); +#endif } sal_Int32 SAL_CALL Inflater::getRemaining( ) @@ -202,7 +216,11 @@ sal_Int32 SAL_CALL Inflater::getTotalOut( ) void SAL_CALL Inflater::reset( ) { +#ifdef SYSTEM_ZLIB + inflateReset(pStream); +#else z_inflateReset(pStream); +#endif bFinish = bNeedDict = bFinished = sal_False; nOffset = nLength = 0; } @@ -211,7 +229,11 @@ void SAL_CALL Inflater::end( ) { if (pStream != NULL) { +#ifdef SYSTEM_ZLIB + inflateEnd(pStream); +#else z_inflateEnd(pStream); +#endif delete pStream; } pStream = NULL; @@ -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->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); +#endif switch (nResult) { |