зеркало из https://github.com/mozilla/gecko-dev.git
Part of IDL migration.
This commit is contained in:
Родитель
7cc31b0783
Коммит
13641ab3ed
|
@ -37,8 +37,8 @@ public:
|
|||
|
||||
NS_IMETHOD GetCategory(const nsString* category, nsString* result) = 0;
|
||||
|
||||
/* void GetCategory (in string category, out string result); */
|
||||
NS_IMETHOD GetCategory(const char *category, char **result) = 0;
|
||||
/* void GetCategory (in wstring category, [shared, retval] out wstring result); */
|
||||
NS_IMETHOD GetCategory(const PRUnichar *category, const PRUnichar **result) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -92,30 +92,20 @@ nsLocale::GetCategory(const nsString* category,nsString* result)
|
|||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsLocale::GetCategory(const char *category, char **result)
|
||||
nsLocale::GetCategory(const PRUnichar *category, const PRUnichar **result)
|
||||
{
|
||||
nsAutoString categoryIn(category);
|
||||
nsString resultOut;
|
||||
nsresult res;
|
||||
|
||||
res = GetCategory(&categoryIn, &resultOut);
|
||||
const nsString* value;
|
||||
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
// Convert result to C string.
|
||||
char *tmp = resultOut.ToNewCString();
|
||||
if (NULL == tmp) {
|
||||
res = NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
else {
|
||||
*result = PL_strdup(tmp);
|
||||
if (NULL == *result) {
|
||||
res = NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
delete [] tmp;
|
||||
}
|
||||
}
|
||||
value = (const nsString*)PL_HashTableLookup(fHashtable,category);
|
||||
if (value!=NULL)
|
||||
{
|
||||
(*result)=value->GetUnicode();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
|
||||
NS_IMETHOD GetCategory(const nsString* category, nsString* result);
|
||||
|
||||
NS_IMETHOD GetCategory(const char *category, char **result);
|
||||
NS_IMETHOD GetCategory(const PRUnichar *category, const PRUnichar **result);
|
||||
|
||||
private:
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче