writerperfect/source/common/WPXSvStream.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
New commits: commit 4b4a870b176cf5ff9ee84fc5b16f4df1d8eeef94 Author: Fridrich Å trba <[email protected]> Date: Mon Jan 6 16:43:17 2014 +0100 Avoid some memcpy when not necessary Change-Id: I9b838fc8392bc61be4ed911fb1423a1e97af2356 diff --git a/writerperfect/source/common/WPXSvStream.cxx b/writerperfect/source/common/WPXSvStream.cxx index 3b33a17..86e835b 100644 --- a/writerperfect/source/common/WPXSvStream.cxx +++ b/writerperfect/source/common/WPXSvStream.cxx @@ -310,9 +310,7 @@ const unsigned char *WPXSvInputStream::read(unsigned long numBytes, unsigned lon mpImpl->mnReadBufferLength = mpImpl->mnLength - curpos; } else - mpImpl->mnReadBufferLength = numBytes; - - mpImpl->seek((long) curpos); + return mpImpl->read(numBytes, numBytesRead); mpImpl->mpReadBuffer = new unsigned char[mpImpl->mnReadBufferLength]; unsigned long tmpNumBytes(0); @@ -360,7 +358,7 @@ int WPXSvInputStream::seek(long offset, WPX_SEEK_TYPE seekType) if (tmpOffset < mpImpl->tell() && (unsigned long)tmpOffset >= (unsigned long)mpImpl->tell() - mpImpl->mnReadBufferLength) { mpImpl->mnReadBufferPos = (unsigned long)(tmpOffset + (long) mpImpl->mnReadBufferLength - (long) mpImpl->tell()); - return 0; + return retVal; } mpImpl->invalidateReadBuffer();
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
