Add richedit support for a plain text stream.

This commit is contained in:
Duane Clark 2002-07-08 19:37:18 +00:00 committed by Alexandre Julliard
parent 52ab395c00
commit 577ea0cbc3
4 changed files with 21 additions and 5 deletions

View File

@ -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)

View File

@ -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();

View File

@ -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 */

View File

@ -124,8 +124,10 @@ TextClass ()
char buf[rtfBufSiz];
TRACE("\n");
if (rtfMinor != rtfSC_nothing)
if (rtfFormat == SF_TEXT)
PutLitChar (rtfMajor);
else if (rtfMinor != rtfSC_nothing)
PutStdChar (rtfMinor);
else
{