[Libreoffice-commits] core.git: 2 commits - include/tools tools/source

Matteo Casalin matteo.casalin at yahoo.com
Sat Jul 16 16:26:38 UTC 2016


 include/tools/inetstrm.hxx     |    2 --
 tools/source/inet/inetmsg.cxx  |    1 -
 tools/source/inet/inetstrm.cxx |   12 +++++++++---
 3 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 7b2966dbf283b168fa0cc1eadf989387ab6e25b9
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Jun 4 16:19:23 2016 +0200

    nBufSiz can be a non-class local constant
    
    Change-Id: I2a7d32eabd01622261a1163781ac2a8b64bdee3f

diff --git a/include/tools/inetstrm.hxx b/include/tools/inetstrm.hxx
index e7a0a99..8d6353b 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 f1082a1f..99716a1 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.
commit 30d722a8f91b667cf56cab2ab6e2f5b2ed18408c
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Jun 4 13:23:31 2016 +0200

    Reduce #include dependencies
    
    Change-Id: I5c6c379717869028102ab2a1ae7929dfbc447904

diff --git a/include/tools/inetstrm.hxx b/include/tools/inetstrm.hxx
index 834df85..e7a0a99 100644
--- a/include/tools/inetstrm.hxx
+++ b/include/tools/inetstrm.hxx
@@ -21,7 +21,6 @@
 
 #include <tools/toolsdllapi.h>
 #include <sal/types.h>
-#include <rtl/ustring.hxx>
 
 class INetMIMEMessage;
 class SvMemoryStream;
diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx
index 19eed71..b488ff9 100644
--- a/tools/source/inet/inetmsg.cxx
+++ b/tools/source/inet/inetmsg.cxx
@@ -22,7 +22,6 @@
 #include <tools/datetime.hxx>
 #include <tools/inetmime.hxx>
 #include <tools/inetmsg.hxx>
-#include <tools/inetstrm.hxx>
 #include <tools/contnr.hxx>
 #include <rtl/instance.hxx>
 #include <comphelper/string.hxx>


More information about the Libreoffice-commits mailing list