[COMCTL32] Don't hardcode dwCaretWidth parameter while calling CreateCaret

Also replace 0 with NULL for the second argument of the function call.

CORE-18151
This commit is contained in:
Jose Carlos Jesus 2022-09-16 16:50:27 +01:00 committed by Stanislav Motylkov
parent 9789e9c409
commit a3eda784a5
No known key found for this signature in database
GPG key ID: AFE513258CBA9E92
2 changed files with 14 additions and 2 deletions

View file

@ -3696,8 +3696,10 @@ static void EDIT_WM_SetFocus(HTHEME theme, EDITSTATE *es)
#ifdef __REACTOS__
SystemParametersInfo(SPI_GETCARETWIDTH, 0, &es->dwCaretWidth, 0);
#endif
CreateCaret(es->hwndSelf, NULL, es->dwCaretWidth, es->line_height);
#else
CreateCaret(es->hwndSelf, 0, 1, es->line_height);
#endif
EDIT_SetCaretPos(es, es->selection_end, es->flags & EF_AFTER_WRAP);
ShowCaret(es->hwndSelf);
EDIT_NOTIFY_PARENT(es, EN_SETFOCUS);
@ -3752,7 +3754,11 @@ static void EDIT_WM_SetFont(EDITSTATE *es, HFONT font, BOOL redraw)
EDIT_UpdateText(es, NULL, TRUE);
if (es->flags & EF_FOCUSED) {
DestroyCaret();
#ifdef __REACTOS__
CreateCaret(es->hwndSelf, NULL, es->dwCaretWidth, es->line_height);
#else
CreateCaret(es->hwndSelf, 0, 1, es->line_height);
#endif
EDIT_SetCaretPos(es, es->selection_end,
es->flags & EF_AFTER_WRAP);
ShowCaret(es->hwndSelf);

View file

@ -3910,8 +3910,10 @@ static void EDIT_WM_SetFocus(EDITSTATE *es)
#ifdef __REACTOS__
SystemParametersInfo(SPI_GETCARETWIDTH, 0, &es->dwCaretWidth, 0);
#endif
CreateCaret(es->hwndSelf, NULL, es->dwCaretWidth, es->line_height);
#else
CreateCaret(es->hwndSelf, 0, 1, es->line_height);
#endif
EDIT_SetCaretPos(es, es->selection_end,
es->flags & EF_AFTER_WRAP);
ShowCaret(es->hwndSelf);
@ -3962,7 +3964,11 @@ static void EDIT_WM_SetFont(EDITSTATE *es, HFONT font, BOOL redraw)
EDIT_UpdateText(es, NULL, TRUE);
if (es->flags & EF_FOCUSED) {
DestroyCaret();
#ifdef __REACTOS__
CreateCaret(es->hwndSelf, NULL, es->dwCaretWidth, es->line_height);
#else
CreateCaret(es->hwndSelf, 0, 1, es->line_height);
#endif
EDIT_SetCaretPos(es, es->selection_end,
es->flags & EF_AFTER_WRAP);
ShowCaret(es->hwndSelf);