instsetoo_native/util/openoffice.lst | 8 shell/inc/internal/stream_helper.hxx | 4 shell/inc/internal/types.hxx | 2 shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx | 7 shell/source/win32/zipfile/zipfile.cxx | 115 +++++++++----- solenv/inc/minor.mk | 4 6 files changed, 91 insertions(+), 49 deletions(-)
New commits: commit 7d8745e4f852f867ac7bc02997b1be353633449f Author: Andras Timar <[email protected]> Date: Wed Oct 16 15:05:28 2013 +0200 Bump for 3.6-32 Change-Id: I3dccc20c6b6a237954c136a14af215c6c385a877 diff --git a/instsetoo_native/util/openoffice.lst b/instsetoo_native/util/openoffice.lst index 21ee86d..1393da5 100644 --- a/instsetoo_native/util/openoffice.lst +++ b/instsetoo_native/util/openoffice.lst @@ -32,7 +32,7 @@ Globals CREATE_MSP_INSTALLSET 1 UPDATE_DATABASE_LISTNAME finals_instsetoo.txt PACKAGEMAP package_names.txt,package_names_ext.txt - WINDOWSPATCHLEVEL 31 + WINDOWSPATCHLEVEL 32 OOOVENDOR The Document Foundation OOODOWNLOADNAME 1 BUILDIDCWS {buildidcws} @@ -57,7 +57,7 @@ LibreOffice BRANDPACKAGEVERSION 3.6 USERDIRPRODUCTVERSION 3 ABOUTBOXPRODUCTVERSION 3.6 - ABOUTBOXPRODUCTVERSIONSUFFIX :build-531 + ABOUTBOXPRODUCTVERSIONSUFFIX :build-532 BASEPRODUCTVERSION 3.6 PCPFILENAME libreoffice.pcp UPDATEURL http://update.libreoffice.org/check.php @@ -110,7 +110,7 @@ LibreOffice_Dev BRANDPACKAGEVERSION 3.6 USERDIRPRODUCTVERSION 3 ABOUTBOXPRODUCTVERSION 3.6 - ABOUTBOXPRODUCTVERSIONSUFFIX :build-531 + ABOUTBOXPRODUCTVERSIONSUFFIX :build-532 BASEPRODUCTVERSION 3.6 DEVELOPMENTPRODUCT 1 BASISPACKAGEPREFIX lodevbasis @@ -380,7 +380,7 @@ OxygenOffice BRANDPACKAGEVERSION 3.6 USERDIRPRODUCTVERSION 3 ABOUTBOXPRODUCTVERSION 3.6 - ABOUTBOXPRODUCTVERSIONSUFFIX :build-531 + ABOUTBOXPRODUCTVERSIONSUFFIX :build-532 BASEPRODUCTVERSION 3.6 PCPFILENAME openoffice.pcp UPDATEURL http://update.libreoffice.org/check.php diff --git a/solenv/inc/minor.mk b/solenv/inc/minor.mk index 59249f5..7fd1240 100644 --- a/solenv/inc/minor.mk +++ b/solenv/inc/minor.mk @@ -1,6 +1,6 @@ RSCVERSION=360 -RSCREVISION=360m1(Build:531) -BUILD=531 +RSCREVISION=360m1(Build:532) +BUILD=532 LAST_MINOR=m1 SOURCEVERSION=OOO360 commit 86b94ce821f12a4bdd15b9e3f5333f5dbe563fd8 Author: Tor Lillqvist <[email protected]> Date: Fri Oct 4 19:36:57 2013 +0200 fdo#67534: try to avoid file locking in Explorer shell extensions Change-Id: I287395f6c25b1bfb9b9482166ae6f34d9af8f455 diff --git a/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx b/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx index 5ab0c20..f41aa09 100644 --- a/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx +++ b/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx @@ -115,7 +115,8 @@ long BufferStream::sseek (long offset, int origin) FileStream::FileStream(const char *filename) : file(0) { - file = fopen(filename, "rb"); + // fdo#67534: avoid locking to not interfere with soffice opening the file + file = _fsopen(filename, "rb", _SH_DENYNO); } FileStream::~FileStream() commit e5a1c6461d4ca4d82925dccabd91e1c08bb560b6 Author: Fridrich Å trba <[email protected]> Date: Tue Jul 16 17:13:14 2013 +0200 bnc#829017 fix issue with negative seeks in win32 shell extension Change-Id: Ia8072f78ad43281e406377922f50f8de53194f1b diff --git a/shell/inc/internal/stream_helper.hxx b/shell/inc/internal/stream_helper.hxx index f0d41bb..23745d7 100644 --- a/shell/inc/internal/stream_helper.hxx +++ b/shell/inc/internal/stream_helper.hxx @@ -40,7 +40,7 @@ public: ~BufferStream(); unsigned long sread (unsigned char *vuf, unsigned long size); long stell (); - long sseek (unsigned long offset, int origin); + long sseek (long offset, int origin); private: IStream *stream; }; @@ -52,7 +52,7 @@ public: ~FileStream(); unsigned long sread (unsigned char *buf, unsigned long size); long stell (); - long sseek (unsigned long offset, int origin); + long sseek (long offset, int origin); private: FILE *file; }; diff --git a/shell/inc/internal/types.hxx b/shell/inc/internal/types.hxx index c6fbfac..628c9f6 100644 --- a/shell/inc/internal/types.hxx +++ b/shell/inc/internal/types.hxx @@ -87,7 +87,7 @@ public: virtual ~StreamInterface() {} virtual unsigned long sread (unsigned char* vuf, unsigned long size) = 0; virtual long stell () = 0; - virtual long sseek (unsigned long offset, int origin) = 0; + virtual long sseek (long offset, int origin) = 0; }; #endif diff --git a/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx b/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx index e4ace54..5ab0c20 100644 --- a/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx +++ b/shell/source/win32/shlxthandler/ooofilt/stream_helper.cxx @@ -83,7 +83,7 @@ long BufferStream::stell () return -1; } -long BufferStream::sseek (unsigned long offset, int origin) +long BufferStream::sseek (long offset, int origin) { HRESULT hr; LARGE_INTEGER Move; @@ -138,7 +138,7 @@ long FileStream::stell () return -1L; } -long FileStream::sseek (unsigned long offset, int origin) +long FileStream::sseek (long offset, int origin) { if (file) return fseek(file, offset, origin); commit 7a530a1fc9a318c21a697ac17fc8c7c6ca63fe6b Author: Mathieu Parent <[email protected]> Date: Mon Oct 14 22:23:05 2013 +0100 fdo#56007 - Read more bytes on Zip read (for thumbnails) Change-Id: Ia8c6caa44ed8019a8139beb5a855f0f28805544d diff --git a/shell/source/win32/zipfile/zipfile.cxx b/shell/source/win32/zipfile/zipfile.cxx index 2188579..2a31247 100644 --- a/shell/source/win32/zipfile/zipfile.cxx +++ b/shell/source/win32/zipfile/zipfile.cxx @@ -127,18 +127,42 @@ static unsigned char readByte(StreamInterface *stream) static unsigned short readShort(StreamInterface *stream) { - unsigned short p0 = (unsigned short)readByte(stream); - unsigned short p1 = (unsigned short)readByte(stream); - return (unsigned short)(p0|(p1<<8)); + if (!stream || stream->stell() == -1) + throw IOException(-1); + unsigned short tmpBuf; + unsigned long numBytesRead = stream->sread( + reinterpret_cast<unsigned char *>( &tmpBuf ), 2); + if (numBytesRead != 2) + throw IOException(-1); + return tmpBuf; } static unsigned readInt(StreamInterface *stream) { - unsigned p0 = (unsigned)readByte(stream); - unsigned p1 = (unsigned)readByte(stream); - unsigned p2 = (unsigned)readByte(stream); - unsigned p3 = (unsigned)readByte(stream); - return (unsigned)(p0|(p1<<8)|(p2<<16)|(p3<<24)); + if (!stream || stream->stell() == -1) + throw IOException(-1); + unsigned tmpBuf; + unsigned long numBytesRead = stream->sread( + reinterpret_cast<unsigned char *>( &tmpBuf ), 4); + if (numBytesRead != 4) + throw IOException(-1); + return tmpBuf; +} + +static std::string readString(StreamInterface *stream, unsigned long size) +{ + if (!stream || stream->stell() == -1) + throw IOException(-1); + unsigned char *tmp = new unsigned char[size]; + if (!tmp) + throw IOException(-1); + unsigned long numBytesRead = stream->sread(tmp, size); + if (numBytesRead != size) + throw IOException(-1); + + std::string aStr((char *)tmp, size); + delete [] tmp; + return aStr; } static bool readCentralDirectoryEnd(StreamInterface *stream, CentralDirectoryEnd &end) @@ -156,9 +180,7 @@ static bool readCentralDirectoryEnd(StreamInterface *stream, CentralDirectoryEnd end.cdir_size = readInt(stream); end.cdir_offset = readInt(stream); end.comment_size = readShort(stream); - end.comment.clear(); - for (unsigned short i = 0; i < end.comment_size; i++) - end.comment.append(1,(char)readByte(stream)); + end.comment.assign(readString(stream, end.comment_size)); } catch (...) { @@ -192,15 +214,9 @@ static bool readCentralDirectoryEntry(StreamInterface *stream, CentralDirectoryE entry.external_attr = readInt(stream); entry.offset = readInt(stream); unsigned short i = 0; - entry.filename.clear(); - for (i=0; i < entry.filename_size; i++) - entry.filename.append(1,(char)readByte(stream)); - entry.extra_field.clear(); - for (i=0; i < entry.extra_field_size; i++) - entry.extra_field.append(1,(char)readByte(stream)); - entry.file_comment.clear(); - for (i=0; i < entry.file_comment_size; i++) - entry.file_comment.append(1,(char)readByte(stream)); + entry.filename.assign(readString(stream, entry.filename_size)); + entry.extra_field.assign(readString(stream, entry.extra_field_size)); + entry.file_comment.assign(readString(stream, entry.file_comment_size)); } catch (...) { @@ -228,12 +244,8 @@ static bool readLocalFileHeader(StreamInterface *stream, LocalFileHeader &header header.filename_size = readShort(stream); header.extra_field_size = readShort(stream); unsigned short i = 0; - header.filename.clear(); - for (i=0; i < header.filename_size; i++) - header.filename.append(1,(char)readByte(stream)); - header.extra_field.clear(); - for (i=0; i < header.extra_field_size; i++) - header.extra_field.append(1,(char)readByte(stream)); + header.filename.assign(readString(stream, header.filename_size)); + header.extra_field.assign(readString(stream, header.extra_field_size)); } catch (...) { commit 195deb83e0752fd2835866384079a2ac27a84ad6 Author: Michael Meeks <[email protected]> Date: Fri Oct 11 17:43:19 2013 +0100 fdo#56007 - fast zip directory find to accelerate Windows Explorer thumbnail. Change-Id: Id9436def56f40d2bb54dea35bea916bd99964653 diff --git a/shell/source/win32/zipfile/zipfile.cxx b/shell/source/win32/zipfile/zipfile.cxx index 70a20f7..2188579 100644 --- a/shell/source/win32/zipfile/zipfile.cxx +++ b/shell/source/win32/zipfile/zipfile.cxx @@ -111,6 +111,9 @@ struct CentralDirectoryEnd #define LOC_FILE_HEADER_SIG 0x04034b50 #define CDIR_END_SIG 0x06054b50 +// This little lot performs in a truly appalling way without +// buffering eg. on an IStream. + static unsigned char readByte(StreamInterface *stream) { if (!stream || stream->stell() == -1) @@ -259,31 +262,57 @@ static bool areHeadersConsistent(const LocalFileHeader &header, const CentralDir return true; } +#define BLOCK_SIZE 0x800 + +static bool findSignatureAtOffset(StreamInterface *stream, unsigned long nOffset) +{ + // read in reasonably sized chunk, and read more, to get overlapping sigs + unsigned char aBuffer[ BLOCK_SIZE + 4 ]; + + stream->sseek(nOffset, SEEK_SET); + + unsigned long nBytesRead = stream->sread(aBuffer, sizeof(aBuffer)); + if (nBytesRead < 0) + return false; + + for (long n = nBytesRead - 4; n >= 0; n--) + { + if (aBuffer[n ] == 0x50 && aBuffer[n+1] == 0x4b && + aBuffer[n+2] == 0x05 && aBuffer[n+3] == 0x06) + { // a palpable hit ... + stream->sseek(nOffset + n, SEEK_SET); + return true; + } + } + + return false; +} + static bool findCentralDirectoryEnd(StreamInterface *stream) { if (!stream) return false; - stream->sseek(0, SEEK_SET); - if (stream->sseek(-1024, SEEK_END)) stream->sseek(0, SEEK_SET); + + stream->sseek(0,SEEK_END); + + long nLength = stream->stell(); + if (nLength == -1) + return false; + try { - while (stream->stell() != -1) + for (long nOffset = nLength - BLOCK_SIZE; + nOffset > 0; nOffset -= BLOCK_SIZE) { - unsigned signature = readInt(stream); - if (signature == CDIR_END_SIG) - { - stream->sseek(-4, SEEK_CUR); + if (findSignatureAtOffset(stream, nOffset)) return true; - } - else - stream->sseek(-3, SEEK_CUR); } + return findSignatureAtOffset(stream, 0); } catch (...) { return false; } - return false; } static bool isZipStream(StreamInterface *stream)
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
