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 ...@@ -375,7 +375,7 @@ static DWORD CALLBACK ME_AppendToHGLOBAL(DWORD_PTR dwCookie, LPBYTE lpBuff, LONG
return 0; 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; EDITSTREAM es;
ME_GlobalDestStruct gds; ME_GlobalDestStruct gds;
...@@ -384,7 +384,7 @@ static HGLOBAL get_rtf_text(ME_TextEditor *editor, const CHARRANGE *lpchrg) ...@@ -384,7 +384,7 @@ static HGLOBAL get_rtf_text(ME_TextEditor *editor, const CHARRANGE *lpchrg)
gds.nLength = 0; gds.nLength = 0;
es.dwCookie = (DWORD_PTR)&gds; es.dwCookie = (DWORD_PTR)&gds;
es.pfnCallback = ME_AppendToHGLOBAL; 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); GlobalReAlloc(gds.hData, gds.nLength+1, 0);
return gds.hData; return gds.hData;
} }
...@@ -410,10 +410,7 @@ HRESULT ME_GetDataObject(ME_TextEditor *editor, const ME_Cursor *start, ...@@ -410,10 +410,7 @@ HRESULT ME_GetDataObject(ME_TextEditor *editor, const ME_Cursor *start,
obj->fmtetc = GlobalAlloc(GMEM_ZEROINIT, obj->fmtetc_cnt*sizeof(FORMATETC)); obj->fmtetc = GlobalAlloc(GMEM_ZEROINIT, obj->fmtetc_cnt*sizeof(FORMATETC));
InitFormatEtc(obj->fmtetc[0], CF_UNICODETEXT, TYMED_HGLOBAL); InitFormatEtc(obj->fmtetc[0], CF_UNICODETEXT, TYMED_HGLOBAL);
if(editor->mode & TM_RICHTEXT) { if(editor->mode & TM_RICHTEXT) {
CHARRANGE chrg; obj->rtf = get_rtf_text(editor, start, nChars);
chrg.cpMin = ME_GetCursorOfs(start);
chrg.cpMax = chrg.cpMin + nChars;
obj->rtf = get_rtf_text(editor, &chrg);
InitFormatEtc(obj->fmtetc[1], cfRTF, TYMED_HGLOBAL); InitFormatEtc(obj->fmtetc[1], cfRTF, TYMED_HGLOBAL);
} }
......
...@@ -329,7 +329,7 @@ BOOL ME_Redo(ME_TextEditor *editor); ...@@ -329,7 +329,7 @@ BOOL ME_Redo(ME_TextEditor *editor);
void ME_EmptyUndoStack(ME_TextEditor *editor); void ME_EmptyUndoStack(ME_TextEditor *editor);
/* writer.c */ /* 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); LRESULT ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream);
/* clipboard.c */ /* 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