Fix use of nullptr for HIMC type in video/win32_v.cpp
This commit is contained in:
@@ -504,7 +504,7 @@ static bool DrawIMECompositionString()
|
|||||||
static void SetCompositionPos(HWND hwnd)
|
static void SetCompositionPos(HWND hwnd)
|
||||||
{
|
{
|
||||||
HIMC hIMC = ImmGetContext(hwnd);
|
HIMC hIMC = ImmGetContext(hwnd);
|
||||||
if (hIMC != nullptr) {
|
if (hIMC != NULL) {
|
||||||
COMPOSITIONFORM cf;
|
COMPOSITIONFORM cf;
|
||||||
cf.dwStyle = CFS_POINT;
|
cf.dwStyle = CFS_POINT;
|
||||||
|
|
||||||
@@ -526,7 +526,7 @@ static void SetCompositionPos(HWND hwnd)
|
|||||||
static void SetCandidatePos(HWND hwnd)
|
static void SetCandidatePos(HWND hwnd)
|
||||||
{
|
{
|
||||||
HIMC hIMC = ImmGetContext(hwnd);
|
HIMC hIMC = ImmGetContext(hwnd);
|
||||||
if (hIMC != nullptr) {
|
if (hIMC != NULL) {
|
||||||
CANDIDATEFORM cf;
|
CANDIDATEFORM cf;
|
||||||
cf.dwIndex = 0;
|
cf.dwIndex = 0;
|
||||||
cf.dwStyle = CFS_EXCLUDE;
|
cf.dwStyle = CFS_EXCLUDE;
|
||||||
@@ -561,7 +561,7 @@ static LRESULT HandleIMEComposition(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||||||
{
|
{
|
||||||
HIMC hIMC = ImmGetContext(hwnd);
|
HIMC hIMC = ImmGetContext(hwnd);
|
||||||
|
|
||||||
if (hIMC != nullptr) {
|
if (hIMC != NULL) {
|
||||||
if (lParam & GCS_RESULTSTR) {
|
if (lParam & GCS_RESULTSTR) {
|
||||||
/* Read result string from the IME. */
|
/* Read result string from the IME. */
|
||||||
LONG len = ImmGetCompositionString(hIMC, GCS_RESULTSTR, nullptr, 0); // Length is always in bytes, even in UNICODE build.
|
LONG len = ImmGetCompositionString(hIMC, GCS_RESULTSTR, nullptr, 0); // Length is always in bytes, even in UNICODE build.
|
||||||
@@ -624,7 +624,7 @@ static LRESULT HandleIMEComposition(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||||||
static void CancelIMEComposition(HWND hwnd)
|
static void CancelIMEComposition(HWND hwnd)
|
||||||
{
|
{
|
||||||
HIMC hIMC = ImmGetContext(hwnd);
|
HIMC hIMC = ImmGetContext(hwnd);
|
||||||
if (hIMC != nullptr) ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
|
if (hIMC != NULL) ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
|
||||||
ImmReleaseContext(hwnd, hIMC);
|
ImmReleaseContext(hwnd, hIMC);
|
||||||
/* Clear any marked string from the current edit box. */
|
/* Clear any marked string from the current edit box. */
|
||||||
HandleTextInput(nullptr, true);
|
HandleTextInput(nullptr, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user