Huw Davies : riched20: Update the auto url detection after a StreamIn.

Alexandre Julliard julliard at winehq.org
Thu Aug 11 09:37:48 CDT 2016


Module: wine
Branch: master
Commit: adb43b91922404f76a3952d8be1c2608fe2479ac
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=adb43b91922404f76a3952d8be1c2608fe2479ac

Author: Huw Davies <huw at codeweavers.com>
Date:   Thu Aug 11 11:32:04 2016 +0100

riched20: Update the auto url detection after a StreamIn.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/riched20/editor.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 9ec72e2..fb77a67 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -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 */




More information about the wine-cvs mailing list