summaryrefslogtreecommitdiff
path: root/writerperfect
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-09-13 12:40:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-09-13 13:28:16 +0200
commit747a9838ee53a4d2c005729419047b1ffde0db70 (patch)
treed32ab5e5b6a079e1bf2b1e7ccb012242f48b1316 /writerperfect
parent32d2e001bb056e7d98aa143b222f2721967337dc (diff)
loplugin:unusedmethods
Change-Id: I00f228451574ca9f9e352d233c7f326c88e90a95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156892 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'writerperfect')
-rw-r--r--writerperfect/inc/WPXSvInputStream.hxx1
-rw-r--r--writerperfect/source/common/WPXSvInputStream.cxx61
2 files changed, 0 insertions, 62 deletions
diff --git a/writerperfect/inc/WPXSvInputStream.hxx b/writerperfect/inc/WPXSvInputStream.hxx
index 45d8e0008861..9370e655fd2f 100644
--- a/writerperfect/inc/WPXSvInputStream.hxx
+++ b/writerperfect/inc/WPXSvInputStream.hxx
@@ -51,7 +51,6 @@ public:
private:
tools::Long tellImpl();
- const unsigned char* readImpl(unsigned long numBytes, unsigned long& numBytesRead);
int seek(tools::Long offset);
void invalidateReadBuffer();
bool isOLE();
diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx
index ded992e69c5c..c7bbd12ddb2e 100644
--- a/writerperfect/source/common/WPXSvInputStream.cxx
+++ b/writerperfect/source/common/WPXSvInputStream.cxx
@@ -761,67 +761,6 @@ void WPXSvInputStream::ensureZipIsInitialized()
WPXSvInputStream::~WPXSvInputStream() {}
-#define BUFFER_MAX 65536
-
-const unsigned char* WPXSvInputStream::readImpl(unsigned long numBytes, unsigned long& numBytesRead)
-{
- numBytesRead = 0;
-
- if (numBytes == 0 || numBytes > std::numeric_limits<unsigned long>::max() / 2)
- return nullptr;
-
- if (mpReadBuffer)
- {
- if ((mnReadBufferPos + numBytes > mnReadBufferPos)
- && (mnReadBufferPos + numBytes <= mnReadBufferLength))
- {
- const unsigned char* pTmp = mpReadBuffer + mnReadBufferPos;
- mnReadBufferPos += numBytes;
- numBytesRead = numBytes;
- return pTmp;
- }
-
- invalidateReadBuffer();
- }
-
- unsigned long curpos = static_cast<unsigned long>(tellImpl());
- if (curpos == static_cast<unsigned long>(-1)) // returned ERROR
- return nullptr;
-
- if ((curpos + numBytes < curpos) /*overflow*/
- || (curpos + numBytes >= o3tl::make_unsigned(mnLength))) /*reading more than available*/
- {
- numBytes = mnLength - curpos;
- }
-
- if (numBytes < BUFFER_MAX)
- {
- if (BUFFER_MAX < mnLength - curpos)
- mnReadBufferLength = BUFFER_MAX;
- else /* BUFFER_MAX >= mnLength - curpos */
- mnReadBufferLength = mnLength - curpos;
- }
- else
- mnReadBufferLength = numBytes;
-
- unsigned long tmpNumBytes(0);
- mpReadBuffer = readImpl(mnReadBufferLength, tmpNumBytes);
- if (tmpNumBytes != mnReadBufferLength)
- mnReadBufferLength = tmpNumBytes;
-
- mnReadBufferPos = 0;
- if (!mnReadBufferLength)
- return nullptr;
-
- if (numBytes <= mnReadBufferLength)
- numBytesRead = numBytes;
- else
- numBytesRead = mnReadBufferLength;
-
- mnReadBufferPos += numBytesRead;
- return mpReadBuffer;
-}
-
long WPXSvInputStream::tell()
{
tools::Long retVal = tellImpl();