Module: wine Branch: refs/heads/master Commit: 4d74e1dbfb912e9b93986c5ebdd368b097052ef4 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=4d74e1dbfb912e9b93986c5e...
Author: Kevin Koltzau kevin@plop.org Date: Sun Feb 5 13:05:06 2006 +0100
riched20: Add method to stream data based on a range.
---
dlls/riched20/editor.h | 1 + dlls/riched20/writer.c | 26 ++++++++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index bd34166..ec8bd5b 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -241,4 +241,5 @@ extern HANDLE me_heap; extern void DoWrap(ME_TextEditor *editor);
/* 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); diff --git a/dlls/riched20/writer.c b/dlls/riched20/writer.c index 5e2cee5..125332d 100644 --- a/dlls/riched20/writer.c +++ b/dlls/riched20/writer.c @@ -810,18 +810,10 @@ ME_StreamOutText(ME_TextEditor *editor,
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);
- if (dwFormat & SFF_SELECTION) - ME_GetSelection(editor, &nStart, &nTo); - else { - nStart = 0; - nTo = -1; - } if (nTo == -1) { nTo = ME_GetTextLength(editor); @@ -830,7 +822,7 @@ ME_StreamOut(ME_TextEditor *editor, DWOR nTo++; } TRACE("from %d to %d\n", nStart, nTo); - + if (dwFormat & SF_RTF) ME_StreamOutRTF(editor, nStart, nTo - nStart, dwFormat); else if (dwFormat & SF_TEXT || dwFormat & SF_TEXTIZED) @@ -839,3 +831,17 @@ ME_StreamOut(ME_TextEditor *editor, DWOR ME_StreamOutFlush(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); +}