Bug 1394215 - remove use of nsIAtom in nsICharsetConverterManager.idl. r=njn
This commit is contained in:
Родитель
8ef4c90a2a
Коммит
a6290e988a
|
@ -165,8 +165,8 @@ nsCharsetConverterManager::GetCharsetData(const char * aCharset,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsCharsetConverterManager::GetCharsetLangGroup(const char * aCharset,
|
||||
nsIAtom** aResult)
|
||||
nsCharsetConverterManager::GetCharsetLangGroup(const char * aCharset,
|
||||
nsACString& aResult)
|
||||
{
|
||||
// resolve the charset first
|
||||
nsAutoCString charset;
|
||||
|
@ -180,19 +180,17 @@ nsCharsetConverterManager::GetCharsetLangGroup(const char * aCharset,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsCharsetConverterManager::GetCharsetLangGroupRaw(const char * aCharset,
|
||||
nsIAtom** aResult)
|
||||
nsCharsetConverterManager::GetCharsetLangGroupRaw(const char * aCharset,
|
||||
nsACString& aResult)
|
||||
{
|
||||
|
||||
*aResult = nullptr;
|
||||
nsAutoString langGroup;
|
||||
// fully qualify to possibly avoid vtable call
|
||||
nsresult rv = nsCharsetConverterManager::GetCharsetData(
|
||||
aCharset, u".LangGroup", langGroup);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
ToLowerCase(langGroup); // use lowercase for all language atoms
|
||||
*aResult = NS_Atomize(langGroup).take();
|
||||
ToLowerCase(langGroup); // use lowercase for all language groups
|
||||
aResult = NS_ConvertUTF16toUTF8(langGroup);
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsIAtom.idl"
|
||||
|
||||
%{ C++
|
||||
#include "mozilla/Encoding.h"
|
||||
|
@ -58,8 +57,8 @@ interface nsICharsetConverterManager : nsISupports
|
|||
* @throws if aCharset is an unknown charset.
|
||||
* @return the language code for the character encoding.
|
||||
*/
|
||||
nsIAtom getCharsetLangGroup(in string aCharset);
|
||||
nsIAtom getCharsetLangGroupRaw(in string aCharset);
|
||||
AUTF8String getCharsetLangGroup(in string aCharset);
|
||||
AUTF8String getCharsetLangGroupRaw(in string aCharset);
|
||||
|
||||
/**
|
||||
* Support for Modified UTF-7 (MUTF-7) used by IMAP.
|
||||
|
|
|
@ -2011,7 +2011,6 @@ nsresult GetMailNewsFont(MimeObject *obj, bool styleFixed, int32_t *fontPixelSi
|
|||
charset.Assign(text->charset);
|
||||
|
||||
nsCOMPtr<nsICharsetConverterManager> charSetConverterManager2;
|
||||
nsCOMPtr<nsIAtom> langGroupAtom;
|
||||
nsAutoCString prefStr;
|
||||
|
||||
ToLowerCase(charset);
|
||||
|
@ -2021,10 +2020,7 @@ nsresult GetMailNewsFont(MimeObject *obj, bool styleFixed, int32_t *fontPixelSi
|
|||
return rv;
|
||||
|
||||
// get a language, e.g. x-western, ja
|
||||
rv = charSetConverterManager2->GetCharsetLangGroup(charset.get(), getter_AddRefs(langGroupAtom));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
rv = langGroupAtom->ToUTF8String(fontLang);
|
||||
rv = charSetConverterManager2->GetCharsetLangGroup(charset.get(), fontLang);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче