mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1187155 - Remove sphelper.h dependency to avoid ATL. r=jimm
This commit is contained in:
parent
f96286d280
commit
c4db655337
@ -13,8 +13,6 @@
|
||||
#include "mozilla/dom/nsSpeechTask.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
#include <sphelper.h>
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
@ -226,8 +224,18 @@ SapiService::RegisterVoices()
|
||||
return false;
|
||||
}
|
||||
|
||||
nsRefPtr<ISpObjectTokenCategory> category;
|
||||
if (FAILED(CoCreateInstance(CLSID_SpObjectTokenCategory, nullptr, CLSCTX_ALL,
|
||||
IID_ISpObjectTokenCategory,
|
||||
getter_AddRefs(category)))) {
|
||||
return false;
|
||||
}
|
||||
if (FAILED(category->SetId(SPCAT_VOICES, FALSE))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsRefPtr<IEnumSpObjectTokens> voiceTokens;
|
||||
if (FAILED(SpEnumTokens(SPCAT_VOICES, nullptr, nullptr,
|
||||
if (FAILED(category->EnumTokens(nullptr, nullptr,
|
||||
getter_AddRefs(voiceTokens)))) {
|
||||
return false;
|
||||
}
|
||||
@ -238,11 +246,6 @@ SapiService::RegisterVoices()
|
||||
break;
|
||||
}
|
||||
|
||||
WCHAR* description = nullptr;
|
||||
if (FAILED(SpGetDescription(voiceToken, &description))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
nsRefPtr<ISpDataKey> attributes;
|
||||
if (FAILED(voiceToken->OpenKey(L"Attributes",
|
||||
getter_AddRefs(attributes)))) {
|
||||
@ -258,9 +261,15 @@ SapiService::RegisterVoices()
|
||||
// name.
|
||||
nsAutoString hexLcid;
|
||||
LCID lcid = wcstol(language, nullptr, 16);
|
||||
CoTaskMemFree(language);
|
||||
nsAutoString locale;
|
||||
nsWin32Locale::GetXPLocale(lcid, locale);
|
||||
|
||||
WCHAR* description = nullptr;
|
||||
if (FAILED(voiceToken->GetStringValue(nullptr, &description))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
nsAutoString uri;
|
||||
uri.AssignLiteral("urn:moz-tts:sapi:");
|
||||
uri.Append(description);
|
||||
@ -269,6 +278,7 @@ SapiService::RegisterVoices()
|
||||
|
||||
rv = registry->AddVoice(this, uri, nsDependentString(description), locale,
|
||||
true);
|
||||
CoTaskMemFree(description);
|
||||
if (NS_FAILED(rv)) {
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user