summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/tools/inetstrm.hxx4
-rw-r--r--tools/source/inet/inetstrm.cxx20
2 files changed, 11 insertions, 13 deletions
diff --git a/include/tools/inetstrm.hxx b/include/tools/inetstrm.hxx
index 8d6353b632b6..d09aa94fb4d3 100644
--- a/include/tools/inetstrm.hxx
+++ b/include/tools/inetstrm.hxx
@@ -20,10 +20,10 @@
#define INCLUDED_TOOLS_INETSTRM_HXX
#include <tools/toolsdllapi.h>
+#include <tools/stream.hxx>
#include <sal/types.h>
class INetMIMEMessage;
-class SvMemoryStream;
class SvStream;
class TOOLS_DLLPUBLIC INetMIMEMessageStream
@@ -36,7 +36,7 @@ class TOOLS_DLLPUBLIC INetMIMEMessageStream
sal_Char *pWrite;
SvStream *pMsgStrm;
- SvMemoryStream *pMsgBuffer;
+ SvMemoryStream maMsgBuffer;
sal_Char *pMsgRead;
sal_Char *pMsgWrite;
diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx
index 99716a13f5e9..156a24599190 100644
--- a/tools/source/inet/inetstrm.cxx
+++ b/tools/source/inet/inetstrm.cxx
@@ -34,7 +34,7 @@ int INetMIMEMessageStream::GetHeaderLine(sal_Char* pData, sal_uIntPtr nSize)
sal_uIntPtr i, n;
- if (pMsgBuffer->Tell() == 0)
+ if (maMsgBuffer.Tell() == 0)
{
// Insert formatted header into buffer.
n = pSourceMsg->GetHeaderCount();
@@ -44,15 +44,15 @@ int INetMIMEMessageStream::GetHeaderLine(sal_Char* pData, sal_uIntPtr nSize)
if (aHeader.GetValue().getLength())
{
// NYI: Folding long lines.
- pMsgBuffer->WriteCharPtr( aHeader.GetName().getStr() );
- pMsgBuffer->WriteCharPtr( ": " );
- pMsgBuffer->WriteCharPtr( aHeader.GetValue().getStr() );
- pMsgBuffer->WriteCharPtr( "\r\n" );
+ maMsgBuffer.WriteCharPtr( aHeader.GetName().getStr() );
+ maMsgBuffer.WriteCharPtr( ": " );
+ maMsgBuffer.WriteCharPtr( aHeader.GetValue().getStr() );
+ maMsgBuffer.WriteCharPtr( "\r\n" );
}
}
- pMsgWrite = const_cast<char *>(static_cast<sal_Char const *>(pMsgBuffer->GetData()));
- pMsgRead = pMsgWrite + pMsgBuffer->Tell();
+ pMsgWrite = const_cast<char *>(static_cast<sal_Char const *>(maMsgBuffer.GetData()));
+ pMsgRead = pMsgWrite + maMsgBuffer.Tell();
}
n = pMsgRead - pMsgWrite;
@@ -65,7 +65,7 @@ int INetMIMEMessageStream::GetHeaderLine(sal_Char* pData, sal_uIntPtr nSize)
else
{
// Reset buffer.
- pMsgBuffer->Seek(STREAM_SEEK_TO_BEGIN);
+ maMsgBuffer.Seek(STREAM_SEEK_TO_BEGIN);
}
return (pWBuf - pData);
@@ -234,7 +234,6 @@ INetMIMEMessageStream::INetMIMEMessageStream(
pSourceMsg(pMsg),
bHeaderGenerated(headerGenerated),
pMsgStrm(nullptr),
- pMsgBuffer(new SvMemoryStream),
pMsgRead(nullptr),
pMsgWrite(nullptr),
done(false),
@@ -242,7 +241,7 @@ INetMIMEMessageStream::INetMIMEMessageStream(
pChildStrm(nullptr)
{
assert(pMsg != nullptr);
- pMsgBuffer->SetStreamCharSet(RTL_TEXTENCODING_ASCII_US);
+ maMsgBuffer.SetStreamCharSet(RTL_TEXTENCODING_ASCII_US);
pBuffer = new sal_Char[BUFFER_SIZE];
pRead = pWrite = pBuffer;
}
@@ -251,7 +250,6 @@ INetMIMEMessageStream::~INetMIMEMessageStream()
{
delete pChildStrm;
delete [] pBuffer;
- delete pMsgBuffer;
delete pMsgStrm;
}