提交 65cbdc89 编写于 作者: D dmarkov

8163979: [macosx] Chinese text shows as Latin w/ openVanilla input method

Reviewed-by: prr, serb
上级 c4e7c7c2
/* /*
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -57,15 +57,19 @@ public class CInputMethodDescriptor implements InputMethodDescriptor { ...@@ -57,15 +57,19 @@ public class CInputMethodDescriptor implements InputMethodDescriptor {
} }
static Object[] getAvailableLocalesInternal() { static Object[] getAvailableLocalesInternal() {
List workList = nativeGetAvailableLocales(); List<Object> workList = nativeGetAvailableLocales();
Locale currentLocale = CInputMethod.getNativeLocale();
if (workList != null) {
if (workList == null || workList.isEmpty()) {
return new Object[] {
currentLocale != null ? currentLocale : Locale.getDefault()
};
} else {
if (currentLocale != null && !workList.contains(currentLocale)) {
workList.add(currentLocale);
}
return workList.toArray(); return workList.toArray();
} }
return new Object[] {
Locale.getDefault()
};
} }
/** /**
...@@ -119,5 +123,5 @@ public class CInputMethodDescriptor implements InputMethodDescriptor { ...@@ -119,5 +123,5 @@ public class CInputMethodDescriptor implements InputMethodDescriptor {
} }
private static native void nativeInit(); private static native void nativeInit();
private static native List nativeGetAvailableLocales(); private static native List<Object> nativeGetAvailableLocales();
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册