riched20: Use a paragraph ptr in the clipboard get text function.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2020-11-03 08:44:44 +00:00 committed by Alexandre Julliard
parent b132d8bf05
commit 8b613eb2ed
1 changed files with 3 additions and 4 deletions

View File

@ -344,13 +344,12 @@ static HGLOBAL get_unicode_text(ME_TextEditor *editor, const ME_Cursor *start, i
int pars = 0;
WCHAR *data;
HANDLE ret;
ME_DisplayItem *para;
ME_Paragraph *para;
int nEnd = ME_GetCursorOfs(start) + nChars;
/* count paragraphs in range */
para = start->pPara;
while((para = para->member.para.next_para) &&
para->member.para.nCharOfs <= nEnd)
para = &start->pPara->member.para;
while ((para = para_next( para )) && para->nCharOfs <= nEnd)
pars++;
ret = GlobalAlloc(GMEM_MOVEABLE, sizeof(WCHAR) * (nChars + pars + 1));