Fix use of nullptr for HIMC type in video/win32_v.cpp

pull/88/head
Jonathan G Rennison 5 years ago
parent 028d2505fd
commit 03d7edd828

@ -504,7 +504,7 @@ static bool DrawIMECompositionString()
static void SetCompositionPos(HWND hwnd)
{
HIMC hIMC = ImmGetContext(hwnd);
if (hIMC != nullptr) {
if (hIMC != NULL) {
COMPOSITIONFORM cf;
cf.dwStyle = CFS_POINT;
@ -526,7 +526,7 @@ static void SetCompositionPos(HWND hwnd)
static void SetCandidatePos(HWND hwnd)
{
HIMC hIMC = ImmGetContext(hwnd);
if (hIMC != nullptr) {
if (hIMC != NULL) {
CANDIDATEFORM cf;
cf.dwIndex = 0;
cf.dwStyle = CFS_EXCLUDE;
@ -561,7 +561,7 @@ static LRESULT HandleIMEComposition(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HIMC hIMC = ImmGetContext(hwnd);
if (hIMC != nullptr) {
if (hIMC != NULL) {
if (lParam & GCS_RESULTSTR) {
/* Read result string from the IME. */
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)
{
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);
/* Clear any marked string from the current edit box. */
HandleTextInput(nullptr, true);

Loading…
Cancel
Save