diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:26:25 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:54 +0100 |
commit | 1c4f33b5d8ba6a8cebb0235bb2e7e37e33045a5b (patch) | |
tree | 80530f50cf36927a1e4f31ad0192077bfb0ecf39 /tools/source/inet | |
parent | 175e2adfd1677cb83373b0ba47853493f3b77859 (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: Ia5acfb564f913d52cd25b5d64d06b5280b94cb72
Diffstat (limited to 'tools/source/inet')
-rw-r--r-- | tools/source/inet/inetmime.cxx | 46 | ||||
-rw-r--r-- | tools/source/inet/inetmsg.cxx | 4 | ||||
-rw-r--r-- | tools/source/inet/inetstrm.cxx | 16 |
3 files changed, 33 insertions, 33 deletions
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx index d4229feb15fb..6a817ee967c1 100644 --- a/tools/source/inet/inetmime.cxx +++ b/tools/source/inet/inetmime.cxx @@ -191,7 +191,7 @@ sal_Unicode * convertToUnicode(const sal_Char * pBegin, sal_Size & rSize) { if (eEncoding == RTL_TEXTENCODING_DONTKNOW) - return 0; + return nullptr; rtl_TextToUnicodeConverter hConverter = rtl_createTextToUnicodeConverter(eEncoding); rtl_TextToUnicodeContext hContext @@ -220,7 +220,7 @@ sal_Unicode * convertToUnicode(const sal_Char * pBegin, if (nInfo != 0) { delete[] pBuffer; - pBuffer = 0; + pBuffer = nullptr; } return pBuffer; } @@ -231,7 +231,7 @@ sal_Char * convertFromUnicode(const sal_Unicode * pBegin, sal_Size & rSize) { if (eEncoding == RTL_TEXTENCODING_DONTKNOW) - return 0; + return nullptr; rtl_UnicodeToTextConverter hConverter = rtl_createUnicodeToTextConverter(eEncoding); rtl_UnicodeToTextContext hContext @@ -261,7 +261,7 @@ sal_Char * convertFromUnicode(const sal_Unicode * pBegin, if (nInfo != 0) { delete[] pBuffer; - pBuffer = 0; + pBuffer = nullptr; } return pBuffer; } @@ -437,7 +437,7 @@ class INetMIMECharsetList_Impl Node * m_pFirst; public: - INetMIMECharsetList_Impl(): m_pFirst(0) {} + INetMIMECharsetList_Impl(): m_pFirst(nullptr) {} ~INetMIMECharsetList_Impl(); @@ -497,7 +497,7 @@ struct ParameterList { Parameter * m_pList; - ParameterList(): m_pList(0) {} + ParameterList(): m_pList(nullptr) {} inline ~ParameterList(); @@ -612,7 +612,7 @@ bool parseParameters(ParameterList const & rInput, if (pOutput) pOutput->clear(); - Parameter * pPrev = 0; + Parameter * pPrev = nullptr; for (Parameter * p = rInput.m_pList; p; p = p->m_pNext) { if (p->m_nSection > 0 @@ -1339,7 +1339,7 @@ void INetMIMEEncodedWordOutputSink::finish(bool bWriteTrailer) } else { - sal_Char * pTargetBuffer = NULL; + sal_Char * pTargetBuffer = nullptr; sal_Size nTargetSize = 0; rtl_UnicodeToTextConverter hConverter = rtl_createUnicodeToTextConverter(eCharsetEncoding); @@ -1363,7 +1363,7 @@ void INetMIMEEncodedWordOutputSink::finish(bool bWriteTrailer) & RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL)) break; delete[] pTargetBuffer; - pTargetBuffer = NULL; + pTargetBuffer = nullptr; rtl_resetUnicodeToTextContext(hConverter, hContext); } rtl_destroyUnicodeToTextContext(hConverter, hContext); @@ -2027,7 +2027,7 @@ const sal_Char * getCharsetName(rtl_TextEncoding eEncoding) default: OSL_FAIL("getCharsetName(): Unsupported encoding"); - return 0; + return nullptr; } } @@ -2355,12 +2355,12 @@ sal_Unicode const * INetMIME::scanContentType( ++p; } if (p == pTypeBegin) - return 0; + return nullptr; sal_Unicode const * pTypeEnd = p; p = skipLinearWhiteSpaceComment(p, pEnd); if (p == pEnd || *p++ != '/') - return 0; + return nullptr; p = skipLinearWhiteSpaceComment(p, pEnd); sal_Unicode const * pSubTypeBegin = p; @@ -2369,14 +2369,14 @@ sal_Unicode const * INetMIME::scanContentType( ++p; } if (p == pSubTypeBegin) - return 0; + return nullptr; sal_Unicode const * pSubTypeEnd = p; - if (pType != 0) + if (pType != nullptr) { *pType = OUString(pTypeBegin, pTypeEnd - pTypeBegin).toAsciiLowerCase(); } - if (pSubType != 0) + if (pSubType != nullptr) { *pSubType = OUString(pSubTypeBegin, pSubTypeEnd - pSubTypeBegin) .toAsciiLowerCase(); @@ -2439,7 +2439,7 @@ OUString INetMIME::decodeHeaderFieldBody(const OString& rBody) if (bEncodedWord) { const sal_Char * pCharsetBegin = q; - const sal_Char * pLanguageBegin = 0; + const sal_Char * pLanguageBegin = nullptr; int nAlphaCount = 0; for (bool bDone = false; !bDone;) if (q == pEnd) @@ -2458,10 +2458,10 @@ OUString INetMIME::decodeHeaderFieldBody(const OString& rBody) break; case '-': - if (pLanguageBegin != 0) + if (pLanguageBegin != nullptr) { if (nAlphaCount == 0) - pLanguageBegin = 0; + pLanguageBegin = nullptr; else nAlphaCount = 0; } @@ -2475,7 +2475,7 @@ OUString INetMIME::decodeHeaderFieldBody(const OString& rBody) eCharsetEncoding = getCharsetEncoding( pCharsetBegin, - pLanguageBegin == 0 + pLanguageBegin == nullptr || nAlphaCount == 0 ? q - 1 : pLanguageBegin); bEncodedWord = isMIMECharsetEncoding( @@ -2487,9 +2487,9 @@ OUString INetMIME::decodeHeaderFieldBody(const OString& rBody) break; default: - if (pLanguageBegin != 0 + if (pLanguageBegin != nullptr && (!rtl::isAsciiAlpha(cChar) || ++nAlphaCount > 8)) - pLanguageBegin = 0; + pLanguageBegin = nullptr; break; } } @@ -2656,7 +2656,7 @@ OUString INetMIME::decodeHeaderFieldBody(const OString& rBody) bEncodedWord = bEncodedWord && q != pEnd && *q++ == '='; - sal_Unicode * pUnicodeBuffer = 0; + sal_Unicode * pUnicodeBuffer = nullptr; sal_Size nUnicodeSize = 0; if (bEncodedWord) { @@ -2664,7 +2664,7 @@ OUString INetMIME::decodeHeaderFieldBody(const OString& rBody) = convertToUnicode(sText.getStr(), sText.getStr() + sText.getLength(), eCharsetEncoding, nUnicodeSize); - if (pUnicodeBuffer == 0) + if (pUnicodeBuffer == nullptr) bEncodedWord = false; } diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index 79692a5f371d..ab07afc5b1b2 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -213,7 +213,7 @@ static const std::map<InetMessageMime, const char*> ImplINetMIMEMessageHeaderDat }; INetMIMEMessage::INetMIMEMessage() - : pParent(NULL) + : pParent(nullptr) { for (sal_uInt16 i = 0; i < static_cast<int>(InetMessageMime::NUMHDR); i++) m_nMIMEIndex[static_cast<InetMessageMime>(i)] = CONTAINER_ENTRY_NOTFOUND; @@ -260,7 +260,7 @@ void INetMIMEMessage::SetContentTransferEncoding ( OUString INetMIMEMessage::GetDefaultContentType() { - if (pParent != NULL) + if (pParent != nullptr) { OUString aParentCT (pParent->GetContentType()); if (aParentCT.isEmpty()) diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx index 1a2da1b9309c..af0e8e494307 100644 --- a/tools/source/inet/inetstrm.cxx +++ b/tools/source/inet/inetstrm.cxx @@ -78,7 +78,7 @@ int INetMIMEMessageStream::GetBodyLine(sal_Char* pData, sal_uIntPtr nSize) if (pSourceMsg->GetDocumentLB()) { - if (pMsgStrm == NULL) + if (pMsgStrm == nullptr) pMsgStrm = new SvStream (pSourceMsg->GetDocumentLB()); sal_uIntPtr nRead = pMsgStrm->Read(pWBuf, (pWEnd - pWBuf)); @@ -147,7 +147,7 @@ int INetMIMEMessageStream::GetMsgLine(sal_Char* pData, sal_uIntPtr nSize) // Encapsulated message body. while (!done) { - if (pChildStrm == NULL) + if (pChildStrm == nullptr) { INetMIMEMessage *pChild = pSourceMsg->GetChild(nChildIndex); if (pChild) @@ -201,7 +201,7 @@ int INetMIMEMessageStream::GetMsgLine(sal_Char* pData, sal_uIntPtr nSize) { // Cleanup exhausted child stream. delete pChildStrm; - pChildStrm = NULL; + pChildStrm = nullptr; } } } @@ -210,7 +210,7 @@ int INetMIMEMessageStream::GetMsgLine(sal_Char* pData, sal_uIntPtr nSize) else { // Single part message body. - if (pSourceMsg->GetDocumentLB() == NULL) + if (pSourceMsg->GetDocumentLB() == nullptr) { // Empty message body. return 0; @@ -227,13 +227,13 @@ INetMIMEMessageStream::INetMIMEMessageStream( pSourceMsg(pMsg), bHeaderGenerated(headerGenerated), nBufSiz(2048), - pMsgStrm(NULL), + pMsgStrm(nullptr), pMsgBuffer(new SvMemoryStream), - pMsgRead(NULL), - pMsgWrite(NULL), + pMsgRead(nullptr), + pMsgWrite(nullptr), done(false), nChildIndex(0), - pChildStrm(NULL) + pChildStrm(nullptr) { assert(pMsg != nullptr); pMsgBuffer->SetStreamCharSet(RTL_TEXTENCODING_ASCII_US); |