bool changed = false;
int ptr = 0;
int i = 0;
- char ch = 1;
+ wxChar ch = 1;
int len = wxStrlen(chunk->value);
while (ch != 0)
{
i += 2;
changed = true;
}
- else if (!inVerbatim && ch == '`' && (len >= i+1 && chunk->value[i+1] == '`'))
+ else if (!inVerbatim && ch == _T('`') && (len >= i+1 && chunk->value[i+1] == '`'))
{
BigBuffer[ptr] = '"'; ptr ++;
i += 2;
changed = true;
}
- else if (!inVerbatim && ch == '`') // Change ` to '
+ else if (!inVerbatim && ch == _T('`')) // Change ` to '
{
BigBuffer[ptr] = 39; ptr ++;
i += 1;
changed = true;
}
- else if (ch == '<') // Change < to <
+ else if (ch == _T('<')) // Change < to <
{
BigBuffer[ptr] = 0;
wxStrcat(BigBuffer, _T("<"));
i += 1;
changed = true;
}
- else if (ch == '>') // Change > to >
+ else if (ch == _T('>')) // Change > to >
{
BigBuffer[ptr] = 0;
wxStrcat(BigBuffer, _T(">"));
int braceCount = 0;
while (!end)
{
- char ch = buffer[*pos];
+ wxChar ch = buffer[*pos];
if (ch == _T('{'))
braceCount ++;
else if (ch == _T('}'))
wxChar macroBuf[200];
macroBuf[0] = '\\';
int i = 1;
- char ch;
+ wxChar ch;
while (((ch = buffer[i-1]) != '\n') && (ch != 0))
{
macroBuf[i] = ch;
}
}
- char ch = buffer[pos];
+ wxChar wxCh = buffer[pos];
// End of optional argument -- pretend it's right brace for simplicity
- if (thisArg->optional && (ch == ']'))
- ch = '}';
+ if (thisArg->optional && (wxCh == _T(']')))
+ wxCh = _T('}');
- switch (ch)
+ switch (wxCh)
{
case 0:
- case '}': // End of argument
+ case _T('}'): // End of argument
{
if (buf_ptr > 0)
{
chunk->value = copystring(BigBuffer);
children.Append((wxObject *)chunk);
}
- if (ch == '}') pos ++;
+ if (wxCh == _T('}')) pos ++;
return pos;
}
- case '\\':
+ case _T('\\'):
{
if (buf_ptr > 0) // Finish off the string we've read so far
{
bool end = false;
while (!end)
{
- int ch = buffer[pos];
- if (ch == '}')
+ wxChar ch = buffer[pos];
+ if (ch == _T('}'))
{
noBraces --;
if (noBraces == 0)
}
else
{
- wxTex2RTFBuffer[i] = '}';
+ wxTex2RTFBuffer[i] = _T('}');
i ++;
}
pos ++;
}
- else if (ch == '{')
+ else if (ch == _T('{'))
{
- wxTex2RTFBuffer[i] = '{';
+ wxTex2RTFBuffer[i] = _T('{');
i ++;
pos ++;
}
- else if (ch == '\\' && buffer[pos+1] == '}')
+ else if (ch == _T('\\') && buffer[pos+1] == _T('}'))
{
- wxTex2RTFBuffer[i] = '}';
+ wxTex2RTFBuffer[i] = _T('}');
pos += 2;
i++;
}
- else if (ch == '\\' && buffer[pos+1] == '{')
+ else if (ch == _T('\\') && buffer[pos+1] == _T('{'))
{
- wxTex2RTFBuffer[i] = '{';
+ wxTex2RTFBuffer[i] = _T('{');
pos += 2;
i++;
}
else
{
- wxTex2RTFBuffer[i] = (wxChar)ch;
+ wxTex2RTFBuffer[i] = ch;
pos ++;
i ++;
if (ch == 0)
else if (wxStrncmp(buffer+pos, _T("verb"), 4) == 0)
{
pos += 4;
- if (buffer[pos] == '*')
+ if (buffer[pos] == _T('*'))
pos ++;
// Find the delimiter character
children.Append((wxObject *)chunk);
}
- else
- {
+ else
+ {
wxChar *env = NULL;
bool tmpParseToBrace = true;
TexMacroDef *def = MatchMacro(buffer, &pos, &env, &tmpParseToBrace);
}
// Parse constructs like {\bf thing} as if they were
// \bf{thing}
- case '{':
+ case _T('{'):
{
pos ++;
- if (buffer[pos] == '\\')
+ if (buffer[pos] == _T('\\'))
{
if (buf_ptr > 0)
{
}
}
else
- {
+ {
/*
* If all else fails, we assume that we have
* a pair of braces on their own, so return a `dummy' macro
arg->macroId = chunk->macroId;
pos = ParseArg(arg, arg->children, buffer, pos, NULL, true, customMacroArgs);
- }
+ }
break;
}
- case '$':
+ case _T('$'):
{
if (buf_ptr > 0)
{
pos ++;
- if (buffer[pos] == '$')
+ if (buffer[pos] == _T('$'))
{
TexChunk *chunk = new TexChunk(CHUNK_TYPE_MACRO);
chunk->no_args = 0;
}
break;
}
- case '~':
+ case _T('~'):
{
if (buf_ptr > 0)
{
children.Append((wxObject *)chunk);
break;
}
- case '#': // Either treat as a special TeX character or as a macro arg
+ case _T('#'): // Either treat as a special TeX character or as a macro arg
{
if (buf_ptr > 0)
{
}
break;
}
- case '&':
+ case _T('&'):
{
// Remove white space before and after the ampersand,
// since this is probably a table column separator with
// some convenient -- but useless -- white space in the text.
- while ((buf_ptr > 0) && ((BigBuffer[buf_ptr-1] == ' ') || (BigBuffer[buf_ptr-1] == 9)))
+ while ((buf_ptr > 0) && ((BigBuffer[buf_ptr-1] == _T(' ')) || (BigBuffer[buf_ptr-1] == 9)))
buf_ptr --;
if (buf_ptr > 0)
pos ++;
- while (buffer[pos] == ' ' || buffer[pos] == 9)
+ while (buffer[pos] == _T(' ') || buffer[pos] == 9)
pos ++;
TexChunk *chunk = new TexChunk(CHUNK_TYPE_MACRO);
break;
}
// Eliminate end-of-line comment
- case '%':
+ case _T('%'):
{
- ch = buffer[pos];
- while (ch != 10 && ch != 13 && ch != 0)
+ wxCh = buffer[pos];
+ while (wxCh != 10 && wxCh != 13 && wxCh != 0)
{
pos ++;
- ch = buffer[pos];
+ wxCh = buffer[pos];
}
if (buffer[pos] == 10 || buffer[pos] == 13)
{
// Eliminate tab
case 9:
{
- BigBuffer[buf_ptr] = ' ';
+ BigBuffer[buf_ptr] = _T(' ');
BigBuffer[buf_ptr+1] = 0;
buf_ptr ++;
pos ++;
}
default:
{
- BigBuffer[buf_ptr] = ch;
+ BigBuffer[buf_ptr] = wxCh;
BigBuffer[buf_ptr+1] = 0;
buf_ptr ++;
pos ++;