riched20: Update the auto url detection after a StreamIn.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2016-08-11 11:32:04 +01:00 committed by Alexandre Julliard
parent a65c31e46f
commit adb43b9192
1 changed files with 7 additions and 1 deletions

View File

@ -1559,8 +1559,9 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
if (!invalidRTF && !inStream.editstream->dwError)
{
ME_Cursor start;
from = ME_GetCursorOfs(&editor->pCursors[0]);
if (format & SF_RTF) {
from = ME_GetCursorOfs(&editor->pCursors[0]);
/* setup the RTF parser */
memset(&parser, 0, sizeof parser);
@ -1662,12 +1663,17 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
style = parser.style;
}
else if (format & SF_TEXT)
{
num_read = ME_StreamInText(editor, format, &inStream, style);
to = ME_GetCursorOfs(&editor->pCursors[0]);
}
else
ERR("EM_STREAMIN without SF_TEXT or SF_RTF\n");
/* put the cursor at the top */
if (!(format & SFF_SELECTION))
ME_SetSelection(editor, 0, 0);
ME_CursorFromCharOfs(editor, from, &start);
ME_UpdateLinkAttribute(editor, &start, to - from);
}
/* Restore saved undo mode */