diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-09-17 21:19:56 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-09-17 22:22:34 +0200 |
commit | 9ce08dcc2e32c5554ddf71b79173f8854e0568ad (patch) | |
tree | c1b8e8daf3581d8bc24bd350777cd744efaf4b4e | |
parent | a68b0ef5c1b205e8994b9789765b42bcf028e9e5 (diff) |
writeHeaderFieldBody is only called with bInitialSpace = false
Change-Id: Ib7fe0bee6339bfad0f63794fec3dfb3f24333ff4
-rw-r--r-- | include/tools/inetmime.hxx | 3 | ||||
-rw-r--r-- | tools/source/inet/inetmime.cxx | 23 | ||||
-rw-r--r-- | tools/source/inet/inetmsg.cxx | 2 |
3 files changed, 5 insertions, 23 deletions
diff --git a/include/tools/inetmime.hxx b/include/tools/inetmime.hxx index 37ca4f0d131e..5a0254aa4b34 100644 --- a/include/tools/inetmime.hxx +++ b/include/tools/inetmime.hxx @@ -205,8 +205,7 @@ public: static void writeHeaderFieldBody(INetMIMEOutputSink & rSink, const OUString& rBody, - rtl_TextEncoding ePreferredEncoding, - bool bInitialSpace = true); + rtl_TextEncoding ePreferredEncoding); static OUString decodeHeaderFieldBody(const OString& rBody); diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index 95b88525df44..5e757675ba08 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -972,9 +972,6 @@ createPreferredCharsetList(rtl_TextEncoding eEncoding) class INetMIMEEncodedWordOutputSink { -public: - enum Space { SPACE_NO, SPACE_ALWAYS }; - private: enum { BUFFER_SIZE = 256 }; @@ -988,7 +985,6 @@ private: STATE_BAD }; INetMIMEOutputSink & m_rSink; - Space m_eInitialSpace; sal_uInt32 m_nExtraSpaces; INetMIMECharsetList_Impl * m_pEncodingList; sal_Unicode * m_pBuffer; @@ -1003,7 +999,6 @@ private: public: inline INetMIMEEncodedWordOutputSink(INetMIMEOutputSink & rTheSink, - Space eTheInitialSpace, rtl_TextEncoding ePreferredEncoding); ~INetMIMEEncodedWordOutputSink(); @@ -1016,10 +1011,8 @@ public: }; inline INetMIMEEncodedWordOutputSink::INetMIMEEncodedWordOutputSink( - INetMIMEOutputSink & rTheSink, - Space eTheInitialSpace, rtl_TextEncoding ePreferredEncoding): + INetMIMEOutputSink & rTheSink, rtl_TextEncoding ePreferredEncoding): m_rSink(rTheSink), - m_eInitialSpace(eTheInitialSpace), m_nExtraSpaces(0), m_pEncodingList(createPreferredCharsetList(ePreferredEncoding)), m_ePrevCoding(CODING_NONE), @@ -1190,9 +1183,6 @@ needsEncodedWordEscape(sal_uInt32 nChar) void INetMIMEEncodedWordOutputSink::finish(bool bWriteTrailer) { - if (m_eInitialSpace == SPACE_ALWAYS && m_nExtraSpaces == 0) - m_nExtraSpaces = 1; - if (m_eEncodedWordState == STATE_SECOND_EQUALS) { // If the text is already an encoded word, copy it verbatim: @@ -1405,7 +1395,6 @@ void INetMIMEEncodedWordOutputSink::finish(bool bWriteTrailer) } } - m_eInitialSpace = SPACE_NO; m_nExtraSpaces = 0; m_pEncodingList->reset(); m_pBufferEnd = m_pBuffer; @@ -2398,15 +2387,9 @@ sal_Unicode const * INetMIME::scanContentType( // static void INetMIME::writeHeaderFieldBody(INetMIMEOutputSink & rSink, const OUString& rBody, - rtl_TextEncoding ePreferredEncoding, - bool bInitialSpace) + rtl_TextEncoding ePreferredEncoding) { - INetMIMEEncodedWordOutputSink - aOutput(rSink, - bInitialSpace ? - INetMIMEEncodedWordOutputSink::SPACE_ALWAYS : - INetMIMEEncodedWordOutputSink::SPACE_NO, - ePreferredEncoding); + INetMIMEEncodedWordOutputSink aOutput(rSink, ePreferredEncoding); aOutput.write(rBody.getStr(), rBody.getStr() + rBody.getLength()); aOutput.flush(); } diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index d6ae40b2e14a..8b74bd0aeb18 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -47,7 +47,7 @@ void INetMIMEMessage::SetHeaderField_Impl ( { INetMIMEOutputSink aSink; INetMIME::writeHeaderFieldBody ( - aSink, rValue, osl_getThreadTextEncoding(), false); + aSink, rValue, osl_getThreadTextEncoding()); SetHeaderField_Impl ( INetMessageHeader (rName, aSink.takeBuffer()), rnIndex); } |