Commit 4d74e1db authored by Kevin Koltzau's avatar Kevin Koltzau Committed by Alexandre Julliard

riched20: Add method to stream data based on a range.

parent 374106d1
...@@ -241,4 +241,5 @@ extern HANDLE me_heap; ...@@ -241,4 +241,5 @@ extern HANDLE me_heap;
extern void DoWrap(ME_TextEditor *editor); extern void DoWrap(ME_TextEditor *editor);
/* writer.c */ /* writer.c */
LRESULT ME_StreamOutRange(ME_TextEditor *editor, DWORD dwFormat, int nStart, int nTo, EDITSTREAM *stream);
LRESULT ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream); LRESULT ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream);
...@@ -810,18 +810,10 @@ ME_StreamOutText(ME_TextEditor *editor, int nStart, int nChars, DWORD dwFormat) ...@@ -810,18 +810,10 @@ ME_StreamOutText(ME_TextEditor *editor, int nStart, int nChars, DWORD dwFormat)
LRESULT LRESULT
ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream) ME_StreamOutRange(ME_TextEditor *editor, DWORD dwFormat, int nStart, int nTo, EDITSTREAM *stream)
{ {
int nStart, nTo;
ME_StreamOutInit(editor, stream); ME_StreamOutInit(editor, stream);
if (dwFormat & SFF_SELECTION)
ME_GetSelection(editor, &nStart, &nTo);
else {
nStart = 0;
nTo = -1;
}
if (nTo == -1) if (nTo == -1)
{ {
nTo = ME_GetTextLength(editor); nTo = ME_GetTextLength(editor);
...@@ -830,7 +822,7 @@ ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream) ...@@ -830,7 +822,7 @@ ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream)
nTo++; nTo++;
} }
TRACE("from %d to %d\n", nStart, nTo); TRACE("from %d to %d\n", nStart, nTo);
if (dwFormat & SF_RTF) if (dwFormat & SF_RTF)
ME_StreamOutRTF(editor, nStart, nTo - nStart, dwFormat); ME_StreamOutRTF(editor, nStart, nTo - nStart, dwFormat);
else if (dwFormat & SF_TEXT || dwFormat & SF_TEXTIZED) else if (dwFormat & SF_TEXT || dwFormat & SF_TEXTIZED)
...@@ -839,3 +831,17 @@ ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream) ...@@ -839,3 +831,17 @@ ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream)
ME_StreamOutFlush(editor); ME_StreamOutFlush(editor);
return ME_StreamOutFree(editor); return ME_StreamOutFree(editor);
} }
LRESULT
ME_StreamOut(ME_TextEditor *editor, DWORD dwFormat, EDITSTREAM *stream)
{
int nStart, nTo;
if (dwFormat & SFF_SELECTION)
ME_GetSelection(editor, &nStart, &nTo);
else {
nStart = 0;
nTo = -1;
}
return ME_StreamOutRange(editor, dwFormat, nStart, nTo, stream);
}
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