mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 969872 - Do not try to check the return value of nsTArray::SetLength in nsLocaleService; r=smontagu
This size is not controllable from content. and nsTArray::SetLength's return value is always true for now (I'm converting it to void in bug 969864.)
This commit is contained in:
parent
3edbced6b9
commit
a8de3991dc
@ -171,20 +171,18 @@ nsLocaleService::nsLocaleService(void)
|
||||
|
||||
nsAutoTArray<UniChar, 32> buffer;
|
||||
int size = ::CFStringGetLength(userLocaleStr);
|
||||
if (buffer.SetLength(size + 1))
|
||||
{
|
||||
CFRange range = ::CFRangeMake(0, size);
|
||||
::CFStringGetCharacters(userLocaleStr, range, buffer.Elements());
|
||||
buffer[size] = 0;
|
||||
buffer.SetLength(size + 1);
|
||||
CFRange range = ::CFRangeMake(0, size);
|
||||
::CFStringGetCharacters(userLocaleStr, range, buffer.Elements());
|
||||
buffer[size] = 0;
|
||||
|
||||
// Convert the locale string to the format that Mozilla expects
|
||||
nsAutoString xpLocale(reinterpret_cast<char16_t*>(buffer.Elements()));
|
||||
xpLocale.ReplaceChar('_', '-');
|
||||
// Convert the locale string to the format that Mozilla expects
|
||||
nsAutoString xpLocale(reinterpret_cast<char16_t*>(buffer.Elements()));
|
||||
xpLocale.ReplaceChar('_', '-');
|
||||
|
||||
nsresult rv = NewLocale(xpLocale, getter_AddRefs(mSystemLocale));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mApplicationLocale = mSystemLocale;
|
||||
}
|
||||
nsresult rv = NewLocale(xpLocale, getter_AddRefs(mSystemLocale));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mApplicationLocale = mSystemLocale;
|
||||
}
|
||||
|
||||
::CFRelease(userLocaleStr);
|
||||
|
Loading…
Reference in New Issue
Block a user