[RICHED20] Fix word break procedure for punct (#5021)

Fix the hyperlink on Chinese Rapps. Check punctuation in the word break procedure by using iswpunct function.
Wine Bug: https://bugs.winehq.org/show_bug.cgi?id=54419
CORE-17091
This commit is contained in:
Katayama Hirofumi MZ 2023-02-01 18:29:41 +09:00 committed by GitHub
parent ea55101aad
commit 64527aa948
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -161,7 +161,9 @@ void ME_StrDeleteV(ME_String *s, int nVChar, int nChars)
static int
ME_WordBreakProc(LPWSTR s, INT start, INT len, INT code)
{
#ifndef __REACTOS__
/* FIXME: Native also knows about punctuation */
#endif
TRACE("s==%s, start==%d, len==%d, code==%d\n",
debugstr_wn(s, len), start, len, code);
@ -173,13 +175,23 @@ ME_WordBreakProc(LPWSTR s, INT start, INT len, INT code)
case WB_MOVEWORDLEFT:
while (start && ME_IsWSpace(s[start - 1]))
start--;
#ifdef __REACTOS__
while (start && !ME_IsWSpace(s[start - 1]) && !iswpunct(s[start - 1]))
start--;
#else
while (start && !ME_IsWSpace(s[start - 1]))
start--;
#endif
return start;
case WB_RIGHT:
case WB_MOVEWORDRIGHT:
#ifdef __REACTOS__
while (start < len && !ME_IsWSpace(s[start]) && !iswpunct(s[start]))
start++;
#else
while (start < len && !ME_IsWSpace(s[start]))
start++;
#endif
while (start < len && ME_IsWSpace(s[start]))
start++;
return start;