From 258f4e9f5207f6cce24f2ef8a29a7e34923d1cb9 Mon Sep 17 00:00:00 2001 From: "nhotta%netscape.com" Date: Wed, 20 Feb 2002 03:05:46 +0000 Subject: [PATCH] Changed to use the service for nsIMimeConverter, bug 123699, sr=mscott. --- mailnews/base/util/nsMsgI18N.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mailnews/base/util/nsMsgI18N.cpp b/mailnews/base/util/nsMsgI18N.cpp index b43710ed1bc..dc2053f5648 100644 --- a/mailnews/base/util/nsMsgI18N.cpp +++ b/mailnews/base/util/nsMsgI18N.cpp @@ -405,13 +405,11 @@ char * nsMsgI18NEncodeMimePartIIStr(const char *header, const char *charset, PRB } char *encodedString = nsnull; - nsIMimeConverter *converter; - nsresult res = nsComponentManager::CreateInstance(kCMimeConverterCID, nsnull, - NS_GET_IID(nsIMimeConverter), (void **)&converter); - if (NS_SUCCEEDED(res) && nsnull != converter) { + nsresult res; + nsCOMPtr converter = do_GetService(kCMimeConverterCID, &res); + if (NS_SUCCEEDED(res) && nsnull != converter) res = converter->EncodeMimePartIIStr_UTF8(header, charset, kMIME_ENCODED_WORD_SIZE, &encodedString); - NS_RELEASE(converter); - } + return NS_SUCCEEDED(res) ? encodedString : nsnull; }