aboutsummaryrefslogtreecommitdiff
path: root/src/windows
diff options
context:
space:
mode:
authorssreedharan <none@none>2017-11-24 13:18:36 +0530
committerAlexey Ushakov <Alexey.Ushakov@jetbrains.com>2018-11-26 14:53:13 +0300
commit08f257e9c44a9df97a960298375488211f97aaca (patch)
tree160f43046f573d0481aa127a86f2de355d3574b5 /src/windows
parenta7ebb97312f44150a471e61b956763fd9b5128f1 (diff)
downloadjdk8u_jdk-08f257e9c44a9df97a960298375488211f97aaca.tar.gz
8176072: READING attributes are not available on TSF
Reviewed-by: ssadetsky
Diffstat (limited to 'src/windows')
-rw-r--r--src/windows/classes/sun/awt/windows/WInputMethod.java2
-rw-r--r--src/windows/native/sun/windows/awt_InputTextInfor.cpp24
2 files changed, 18 insertions, 8 deletions
diff --git a/src/windows/classes/sun/awt/windows/WInputMethod.java b/src/windows/classes/sun/awt/windows/WInputMethod.java
index de7c478c08..7010f32d8c 100644
--- a/src/windows/classes/sun/awt/windows/WInputMethod.java
+++ b/src/windows/classes/sun/awt/windows/WInputMethod.java
@@ -493,7 +493,7 @@ final class WInputMethod extends InputMethodAdapter
// set Clause and Reading Information
if (clauseBoundary!=null && clauseReading!=null &&
clauseReading.length!=0 && clauseBoundary.length==clauseReading.length+1 &&
- clauseBoundary[0]==0 && clauseBoundary[clauseReading.length]==text.length() )
+ clauseBoundary[0]==0 && clauseBoundary[clauseReading.length]<=text.length() )
{
for (int i=0; i<clauseBoundary.length-1; i++) {
attrStr.addAttribute(Attribute.INPUT_METHOD_SEGMENT,
diff --git a/src/windows/native/sun/windows/awt_InputTextInfor.cpp b/src/windows/native/sun/windows/awt_InputTextInfor.cpp
index de9248f137..9d996fd096 100644
--- a/src/windows/native/sun/windows/awt_InputTextInfor.cpp
+++ b/src/windows/native/sun/windows/awt_InputTextInfor.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -202,9 +202,15 @@ int AwtInputTextInfor::GetClauseInfor(int*& lpBndClauseW, jstring*& lpReadingCla
m_lpClauseW == NULL || m_lpReadClauseW == NULL ||
m_lpClauseW[0] != 0 || m_lpClauseW[m_cClauseW] != (DWORD)m_cStrW ||
m_lpReadClauseW[0] != 0 || m_lpReadClauseW[m_cReadClauseW] != (DWORD)m_cReadStrW) {
- lpBndClauseW = NULL;
- lpReadingClauseW = NULL;
- return 0;
+ // For cases where IMM sends WM_IME_COMPOSITION with both GCS_COMPSTR and GCS_RESULTSTR
+ // The GCS_RESULTSTR part may have Caluse and Reading information which should not be ignored
+ if (NULL == m_pResultTextInfor) {
+ lpBndClauseW = NULL;
+ lpReadingClauseW = NULL;
+ return 0;
+ } else {
+ return m_pResultTextInfor->GetClauseInfor(lpBndClauseW, lpReadingClauseW);
+ }
}
int* bndClauseW = NULL;
@@ -346,10 +352,14 @@ int AwtInputTextInfor::GetClauseInfor(int*& lpBndClauseW, jstring*& lpReadingCla
//
int AwtInputTextInfor::GetAttributeInfor(int*& lpBndAttrW, BYTE*& lpValAttrW) {
if (m_cStrW == 0 || m_cAttrW != m_cStrW) {
- lpBndAttrW = NULL;
- lpValAttrW = NULL;
+ if (NULL == m_pResultTextInfor) {
+ lpBndAttrW = NULL;
+ lpValAttrW = NULL;
- return 0;
+ return 0;
+ } else {
+ return m_pResultTextInfor->GetAttributeInfor(lpBndAttrW, lpValAttrW);
+ }
}
int* bndAttrW = NULL;