oc-rtf: Use what RTF Spec 1.9.1 for control words

This reverts 7581c0a.
pull/69/head
Enrique J. Hernández Blasco 2014-09-19 16:51:26 +02:00 committed by Julio García
parent 415fb6034e
commit cbfcd54858
1 changed files with 30 additions and 1 deletions

View File

@ -415,10 +415,39 @@ const unsigned short ansicpg874[256] = {
start = ADVANCE;
while (isalnum(*_bytes) || *_bytes == '-' || isspace(*_bytes))
/*
A control word is defined by:
\<ASCII Letter Sequence><Delimiter>
*/
while (isalpha(*_bytes))
{
ADVANCE;
}
/*
The <Delimiter> can be one of the following:
- A space. This serves only to delimit a control word and is
ignored in subsequent processing.
- A numeric digit or an ASCII minus sign (-), which indicates
that a numeric parameter is associated with the control word.
Only this case requires to include it in the control word.
- Any character other than a letter or a digit
*/
if (*_bytes == '-' || isdigit(*_bytes))
{
ADVANCE;
while (isdigit(*_bytes)) // TODO: Allow up to 10 digits
{
ADVANCE;
}
}
/* In this case, the delimiting character terminates the control
word and is not part of the control word. */
end = _bytes;
*len = end-start-1;