Commit 577ea0cb authored by Duane Clark's avatar Duane Clark Committed by Alexandre Julliard

Add richedit support for a plain text stream.

parent 52ab395c
......@@ -123,6 +123,7 @@ int rtfClass;
int rtfMajor;
int rtfMinor;
int rtfParam;
int rtfFormat;
char *rtfTextBuf = (char *) NULL;
int rtfTextLen;
......@@ -540,9 +541,8 @@ RTFFuncPtr p;
(*p) (); /* give read hook a look at token */
/* Silently discard newlines, carriage returns, nulls. */
if (!(rtfClass == rtfText
&& (rtfMajor == '\n' || rtfMajor == '\r'
|| rtfMajor == '\0')))
if (!(rtfClass == rtfText && rtfFormat != SF_TEXT
&& (rtfMajor == '\r' || rtfMajor == '\n' || rtfMajor == '\0')))
break;
}
return (rtfClass);
......@@ -604,6 +604,18 @@ RTFFont *fp;
TRACE("\n");
if (rtfFormat == SF_TEXT) {
rtfMajor = GetChar ();
rtfMinor = rtfSC_nothing;
rtfParam = rtfNoParam;
rtfTextBuf[rtfTextLen = 0] = '\0';
if (rtfMajor == EOF)
rtfClass = rtfEOF;
else
rtfClass = rtfText;
return;
}
/* first check for pushed token from RTFUngetToken() */
if (pushedClass >= 0)
......
......@@ -175,6 +175,7 @@ static LRESULT WINAPI RICHED32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
/* setup the RTF parser */
RTFSetEditStream(( EDITSTREAM*)lParam);
rtfFormat = wParam&(SF_TEXT|SF_RTF);
WriterInit();
RTFInit ();
BeginFile();
......
......@@ -432,6 +432,7 @@ extern int rtfClass; /* token class */
extern int rtfMajor; /* token major number */
extern int rtfMinor; /* token minor number */
extern int rtfParam; /* control symbol parameter */
extern int rtfFormat; /* either SF_RTF or SF_TEXT */
# ifdef THINK_C
# define rtfNoParam (-32768) /* 16-bit max. neg. value */
......
......@@ -125,7 +125,9 @@ char buf[rtfBufSiz];
TRACE("\n");
if (rtfMinor != rtfSC_nothing)
if (rtfFormat == SF_TEXT)
PutLitChar (rtfMajor);
else if (rtfMinor != rtfSC_nothing)
PutStdChar (rtfMinor);
else
{
......
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