Commit 54b53b60 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

richedit: Use ME_Cursor instead of offsets for stream out functions.

parent bd470428
......@@ -375,7 +375,7 @@ static DWORD CALLBACK ME_AppendToHGLOBAL(DWORD_PTR dwCookie, LPBYTE lpBuff, LONG
return 0;
}
static HGLOBAL get_rtf_text(ME_TextEditor *editor, const CHARRANGE *lpchrg)
static HGLOBAL get_rtf_text(ME_TextEditor *editor, const ME_Cursor *start, int nChars)
{
EDITSTREAM es;
ME_GlobalDestStruct gds;
......@@ -384,7 +384,7 @@ static HGLOBAL get_rtf_text(ME_TextEditor *editor, const CHARRANGE *lpchrg)
gds.nLength = 0;
es.dwCookie = (DWORD_PTR)&gds;
es.pfnCallback = ME_AppendToHGLOBAL;
ME_StreamOutRange(editor, SF_RTF, lpchrg->cpMin, lpchrg->cpMax, &es);
ME_StreamOutRange(editor, SF_RTF, start, nChars, &es);
GlobalReAlloc(gds.hData, gds.nLength+1, 0);
return gds.hData;
}
......@@ -410,10 +410,7 @@ HRESULT ME_GetDataObject(ME_TextEditor *editor, const ME_Cursor *start,
obj->fmtetc = GlobalAlloc(GMEM_ZEROINIT, obj->fmtetc_cnt*sizeof(FORMATETC));
InitFormatEtc(obj->fmtetc[0], CF_UNICODETEXT, TYMED_HGLOBAL);
if(editor->mode & TM_RICHTEXT) {
CHARRANGE chrg;
chrg.cpMin = ME_GetCursorOfs(start);
chrg.cpMax = chrg.cpMin + nChars;
obj->rtf = get_rtf_text(editor, &chrg);
obj->rtf = get_rtf_text(editor, start, nChars);
InitFormatEtc(obj->fmtetc[1], cfRTF, TYMED_HGLOBAL);
}
......
......@@ -329,7 +329,7 @@ BOOL ME_Redo(ME_TextEditor *editor);
void ME_EmptyUndoStack(ME_TextEditor *editor);
/* writer.c */
LRESULT ME_StreamOutRange(ME_TextEditor *editor, DWORD dwFormat, int nStart, int nTo, EDITSTREAM *stream);
LRESULT ME_StreamOutRange(ME_TextEditor *editor, DWORD dwFormat, const ME_Cursor *start, int nChars, EDITSTREAM *stream);
LRESULT ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream);
/* clipboard.c */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment