mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
Fix use of nullptr for HIMC type in video/win32_v.cpp
This commit is contained in:
parent
028d2505fd
commit
03d7edd828
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user