Fix error using 'char32_t' as 'wchar_t' on windows

FONT_OT_text_insert failed on Windows.

This change was missing from D6198.
This commit is contained in:
Harley Acheson 2020-06-22 17:10:50 +10:00 committed by Campbell Barton
parent 61fa710aa3
commit 19c7b5f45a
1 changed files with 3 additions and 3 deletions

View File

@ -1635,7 +1635,7 @@ static int insert_text_exec(bContext *C, wmOperator *op)
{
Object *obedit = CTX_data_edit_object(C);
char *inserted_utf8;
wchar_t *inserted_text;
char32_t *inserted_text;
int a, len;
if (!RNA_struct_property_is_set(op->ptr, "text")) {
@ -1645,8 +1645,8 @@ static int insert_text_exec(bContext *C, wmOperator *op)
inserted_utf8 = RNA_string_get_alloc(op->ptr, "text", NULL, 0);
len = BLI_strlen_utf8(inserted_utf8);
inserted_text = MEM_callocN(sizeof(wchar_t) * (len + 1), "FONT_insert_text");
BLI_strncpy_wchar_from_utf8(inserted_text, inserted_utf8, len + 1);
inserted_text = MEM_callocN(sizeof(char32_t) * (len + 1), "FONT_insert_text");
len = BLI_str_utf8_as_utf32(inserted_text, inserted_utf8, MAXTEXT);
for (a = 0; a < len; a++) {
insert_into_textbuf(obedit, inserted_text[a]);