diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2016-06-04 16:19:23 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2016-07-16 18:27:18 +0200 |
commit | 7b2966dbf283b168fa0cc1eadf989387ab6e25b9 (patch) | |
tree | 9f54a9f4b5ce4145302680f9d69850201235a3f7 | |
parent | Reduce #include dependencies (diff) | |
download | core-7b2966dbf283b168fa0cc1eadf989387ab6e25b9.tar.gz core-7b2966dbf283b168fa0cc1eadf989387ab6e25b9.zip |
nBufSiz can be a non-class local constant
Change-Id: I2a7d32eabd01622261a1163781ac2a8b64bdee3f
-rw-r--r-- | include/tools/inetstrm.hxx | 1 | ||||
-rw-r--r-- | tools/source/inet/inetstrm.cxx | 12 |
2 files changed, 9 insertions, 4 deletions
diff --git a/include/tools/inetstrm.hxx b/include/tools/inetstrm.hxx index e7a0a99ee8d2..8d6353b632b6 100644 --- a/include/tools/inetstrm.hxx +++ b/include/tools/inetstrm.hxx @@ -31,7 +31,6 @@ class TOOLS_DLLPUBLIC INetMIMEMessageStream INetMIMEMessage *pSourceMsg; bool bHeaderGenerated; - sal_uIntPtr nBufSiz; sal_Char *pBuffer; sal_Char *pRead; sal_Char *pWrite; diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx index f1082a1f0486..99716a13f5e9 100644 --- a/tools/source/inet/inetstrm.cxx +++ b/tools/source/inet/inetstrm.cxx @@ -222,11 +222,17 @@ int INetMIMEMessageStream::GetMsgLine(sal_Char* pData, sal_uIntPtr nSize) } } +namespace +{ + +const int BUFFER_SIZE = 2048; + +} + INetMIMEMessageStream::INetMIMEMessageStream( INetMIMEMessage *pMsg, bool headerGenerated): pSourceMsg(pMsg), bHeaderGenerated(headerGenerated), - nBufSiz(2048), pMsgStrm(nullptr), pMsgBuffer(new SvMemoryStream), pMsgRead(nullptr), @@ -237,7 +243,7 @@ INetMIMEMessageStream::INetMIMEMessageStream( { assert(pMsg != nullptr); pMsgBuffer->SetStreamCharSet(RTL_TEXTENCODING_ASCII_US); - pBuffer = new sal_Char[nBufSiz]; + pBuffer = new sal_Char[BUFFER_SIZE]; pRead = pWrite = pBuffer; } @@ -271,7 +277,7 @@ int INetMIMEMessageStream::Read(sal_Char* pData, sal_uIntPtr nSize) pRead = pWrite = pBuffer; // Read next message line. - int nRead = GetMsgLine(pBuffer, nBufSiz); + int nRead = GetMsgLine(pBuffer, BUFFER_SIZE); if (nRead > 0) { // Set read pointer. |