summaryrefslogtreecommitdiff
path: root/writerperfect
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2014-01-06 16:43:17 +0100
committerFridrich Štrba <fridrich.strba@bluewin.ch>2014-01-06 16:43:48 +0100
commit4b4a870b176cf5ff9ee84fc5b16f4df1d8eeef94 (patch)
treeba0b080dc82f75c35a6258f6f3b163658dd33667 /writerperfect
parent52263eb4ee841ff101fa54e7fb95d76d2070f91b (diff)
Avoid some memcpy when not necessary
Change-Id: I9b838fc8392bc61be4ed911fb1423a1e97af2356
Diffstat (limited to 'writerperfect')
-rw-r--r--writerperfect/source/common/WPXSvStream.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/writerperfect/source/common/WPXSvStream.cxx b/writerperfect/source/common/WPXSvStream.cxx
index 3b33a170ede3..86e835b0dc23 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();