[COMCTL32] Fix edit control cursor positioning (#7317)

Fix caret positioning regression from Wine Sync to Wine 5.0 affecting notepad.
Restore older Wine code that handles caret position with ReactOS better.
This was a regression from 0.4.15-dev-8612-g0707475 0707475f69

CORE-19731
This commit is contained in:
Doug Lyons 2024-09-06 08:25:40 -05:00 committed by GitHub
parent a509941786
commit bc76250bd8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1050,7 +1050,15 @@ static LRESULT EDIT_EM_PosFromChar(EDITSTATE *es, INT index, BOOL after_wrap)
lw = line_def->width;
w = es->format_rect.right - es->format_rect.left;
if (line_def->ssa)
#ifdef __REACTOS__ /* CORE-19731 & match win32ss/user/user32/controls/edit.c */
{
ScriptStringCPtoX(line_def->ssa, (index - 1) - li, TRUE, &x);
x -= es->x_offset;
}
else
#else
ScriptStringCPtoX(line_def->ssa, (index - 1) - li, TRUE, &x);
#endif
#ifdef __REACTOS__ /* CORE-15780 */
x = (lw > 0 ? es->x_offset : x - es->x_offset);
#else