Cleanup: simplify checks for IME event types

Use a separate block for IME start/event/end for clarity.
This commit is contained in:
Campbell Barton
2023-10-19 18:01:40 +11:00
parent a6e3cfce79
commit 4a813ba5af

View File

@@ -4021,13 +4021,15 @@ static void ui_do_but_textedit(
}
#ifdef WITH_INPUT_IME
if (ELEM(event->type, WM_IME_COMPOSITE_START, WM_IME_COMPOSITE_EVENT)) {
if (event->type == WM_IME_COMPOSITE_START) {
changed = true;
if (event->type == WM_IME_COMPOSITE_START && but->selend > but->selsta) {
if (but->selend > but->selsta) {
ui_textedit_delete_selection(but, data);
}
if (event->type == WM_IME_COMPOSITE_EVENT && ime_data->result_len) {
}
else if (event->type == WM_IME_COMPOSITE_EVENT) {
changed = true;
if (ime_data->result_len) {
if (ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER) &&
STREQ(ime_data->str_result, "\xE3\x80\x82"))
{