// Name: tex2any.cpp
// Purpose: Utilities for Latex conversion.
// Author: Julian Smart
-// Modified by:
+// Modified by: Wlodzimierz ABX Skiba 2003/2004 Unicode support
+// Ron Lee
// Created: 01/01/99
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
* Variables accessible from clients
*
*/
-
+
TexChunk * DocumentTitle = NULL;
TexChunk * DocumentAuthor = NULL;
TexChunk * DocumentDate = NULL;
int subsectionFont = 12; // largeFont1;
int titleFont = LARGEFont3;
int authorFont = LargeFont2;
-int mirrorMargins = TRUE;
-bool winHelp = FALSE; // Output in Windows Help format if TRUE, linear otherwise
-bool isInteractive = FALSE;
-bool runTwice = FALSE;
+int mirrorMargins = true;
+bool winHelp = false; // Output in Windows Help format if true, linear otherwise
+bool isInteractive = false;
+bool runTwice = false;
int convertMode = TEX_RTF;
-bool checkCurleyBraces = FALSE;
-bool checkSyntax = FALSE;
-bool headerRule = FALSE;
-bool footerRule = FALSE;
-bool compatibilityMode = FALSE; // If TRUE, maximum Latex compatibility
+bool checkCurlyBraces = false;
+bool checkSyntax = false;
+bool headerRule = false;
+bool footerRule = false;
+bool compatibilityMode = false; // If true, maximum Latex compatibility
// (Quality of RTF generation deteriorate)
bool generateHPJ; // Generate WinHelp Help Project file
wxChar *winHelpTitle = NULL; // Windows Help title
int labelIndentTab = 18; // From left indent to item label (points)
int itemIndentTab = 40; // From left indent to item (points)
-bool useUpButton = TRUE;
+bool useUpButton = true;
int htmlBrowseButtons = HTML_BUTTONS_TEXT;
-bool truncateFilenames = FALSE; // Truncate for DOS
+bool truncateFilenames = false; // Truncate for DOS
int winHelpVersion = 3; // WinHelp Version (3 for Windows 3.1, 4 for Win95)
-bool winHelpContents = FALSE; // Generate .cnt file for WinHelp 4
-bool htmlIndex = FALSE; // Generate .htx file for HTML
-bool htmlFrameContents = FALSE; // Use frames for HTML contents page
+bool winHelpContents = false; // Generate .cnt file for WinHelp 4
+bool htmlIndex = false; // Generate .htx file for HTML
+bool htmlFrameContents = false; // Use frames for HTML contents page
wxChar *htmlStylesheet = NULL; // Use this CSS stylesheet for HTML pages
-bool useHeadingStyles = TRUE; // Insert \s1, s2 etc.
-bool useWord = TRUE; // Insert proper Word table of contents, etc etc
+bool useHeadingStyles = true; // Insert \s1, s2 etc.
+bool useWord = true; // Insert proper Word table of contents, etc etc
int contentsDepth = 4; // Depth of Word table of contents
-bool indexSubsections = TRUE; // Index subsections in linear RTF
+bool indexSubsections = true; // Index subsections in linear RTF
// Linear RTF method of including bitmaps. Can be "includepicture", "hex"
wxChar *bitmapMethod = copystring(_T("includepicture"));
-bool upperCaseNames = FALSE;
+bool upperCaseNames = false;
// HTML background and text colours
wxChar *backgroundImageString = NULL;
wxChar *backgroundColourString = copystring(_T("255;255;255"));
wxChar *textColourString = NULL;
wxChar *linkColourString = NULL;
wxChar *followedLinkColourString = NULL;
-bool combineSubSections = FALSE;
-bool htmlWorkshopFiles = FALSE;
-bool ignoreBadRefs = FALSE;
-wxChar *htmlFaceName = NULL;
+bool combineSubSections = false;
+bool htmlWorkshopFiles = false;
+bool ignoreBadRefs = false;
+wxChar *htmlFaceName = NULL;
extern int passNumber;
* Section numbering
*
*/
-
+
int chapterNo = 0;
int sectionNo = 0;
int subsectionNo = 0;
* Other variables
*
*/
-
+
FILE *CurrentOutput1 = NULL;
FILE *CurrentOutput2 = NULL;
FILE *Inputs[15];
wxChar *TexFileRoot = NULL;
wxChar *TexBibName = NULL; // Bibliography output file name
wxChar *TexTmpBibName = NULL; // Temporary bibliography output file name
-bool isSync = FALSE; // If TRUE, should not yield to other processes.
-bool stopRunning = FALSE; // If TRUE, should abort.
+bool isSync = false; // If true, should not yield to other processes.
+bool stopRunning = false; // If true, should abort.
static int currentColumn = 0;
wxChar *currentArgData = NULL;
-bool haveArgData = FALSE; // If TRUE, we're simulating the data.
+bool haveArgData = false; // If true, we're simulating the data.
TexChunk *currentArgument = NULL;
TexChunk *nextChunk = NULL;
-bool isArgOptional = FALSE;
+bool isArgOptional = false;
int noArgs = 0;
TexChunk *TopLevel = NULL;
TexRef::TexRef(const wxChar *label, const wxChar *file,
- const wxChar *section, const wxChar *sectionN)
+ const wxChar *section, const wxChar *sectionN)
{
refLabel = copystring(label);
refFile = file ? copystring(file) : (wxChar*) NULL;
break;
}
}
-
+
TexMacroDef *MatchMacro(wxChar *buffer, int *pos, wxChar **env, bool *parseToBrace)
{
- *parseToBrace = TRUE;
+ *parseToBrace = true;
int i = (*pos);
TexMacroDef *def = NULL;
wxChar macroBuf[40];
macroBuf[j-i] = 0;
def = (TexMacroDef *)MacroDefs.Get(macroBuf);
}
-
+
if (def)
{
i = j;
-
+
// We want to check whether this is a space-consuming macro
// (e.g. {\bf word})
// No brace, e.g. \input thing.tex instead of \input{thing};
if ((buffer[i] == 32) || (buffer[i] == '='))
i ++;
- *parseToBrace = FALSE;
+ *parseToBrace = false;
}
*pos = i;
ForbidWarning(def);
{
int len = wxStrlen(buffer);
int j = *pos;
- bool keepGoing = TRUE;
- bool moreLines = TRUE;
+ bool keepGoing = true;
+ bool moreLines = true;
while ((j < len) && keepGoing &&
(buffer[j] == 10 || buffer[j] == 13 || buffer[j] == ' ' || buffer[j] == 9))
{
j = 0;
}
else
- keepGoing = FALSE;
+ keepGoing = false;
}
}
*pos = j;
(wxStrncmp(buffer+i+4, env, wxStrlen(env)) == 0))
{
*pos = i + 5 + wxStrlen(env);
- return TRUE;
+ return true;
}
- else return FALSE;
+ else return false;
}
-bool readingVerbatim = FALSE;
-bool readInVerbatim = FALSE; // Within a verbatim, but not nec. verbatiminput
+bool readingVerbatim = false;
+bool readInVerbatim = false; // Within a verbatim, but not nec. verbatiminput
// Switched this off because e.g. \verb${$ causes it to fail. There is no
// detection of \verb yet.
// #define CHECK_BRACES 1
-unsigned long leftCurley = 0;
-unsigned long rightCurley = 0;
+unsigned long leftCurly = 0;
+unsigned long rightCurly = 0;
static wxString currentFileName = _T("");
bool read_a_line(wxChar *buf)
if (CurrentInputIndex < 0)
{
buf[0] = 0;
- return FALSE;
+ return false;
}
int ch = -2;
unsigned long bufIndex = 0;
buf[0] = 0;
+ int lastChar;
while (ch != EOF && ch != 10)
{
errBuf.Printf(_T("Line %lu of file %s is too long. Lines can be no longer than %lu characters. Truncated."),
LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str(), MAX_LINE_BUFFER_SIZE);
OnError((wxChar *)errBuf.c_str());
- return FALSE;
+ return false;
}
if (((bufIndex == 14) && (wxStrncmp(buf, _T("\\end{verbatim}"), 14) == 0)) ||
((bufIndex == 16) && (wxStrncmp(buf, _T("\\end{toocomplex}"), 16) == 0)))
- readInVerbatim = FALSE;
+ readInVerbatim = false;
+ lastChar = ch;
ch = getc(Inputs[CurrentInputIndex]);
- if (checkCurleyBraces)
+ if (checkCurlyBraces)
{
- if (ch == '{' && !readInVerbatim)
- leftCurley++;
- if (ch == '}' && !readInVerbatim)
+ if (ch == '{' && !readInVerbatim && lastChar != _T('\\'))
+ leftCurly++;
+ if (ch == '}' && !readInVerbatim && lastChar != _T('\\'))
{
- rightCurley++;
- if (rightCurley > leftCurley)
+ rightCurly++;
+ if (rightCurly > leftCurly)
{
wxString errBuf;
- errBuf.Printf(_T("An extra right Curley brace ('}') was detected at line %lu inside file %s"), LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str());
+ errBuf.Printf(_T("An extra right Curly brace ('}') was detected at line %lu inside file %s"), LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str());
OnError((wxChar *)errBuf.c_str());
- // Reduce the count of right Curley braces, so the mismatched count
+ // Reduce the count of right Curly braces, so the mismatched count
// isn't reported on every line that has a '}' after the first mismatch
- rightCurley--;
+ rightCurly--;
}
}
}
if ((ch1 == 10) || (ch1 == 13))
{
// Eliminate newline (10) following DOS linefeed
- if (ch1 == 13)
+ if (ch1 == 13)
getc(Inputs[CurrentInputIndex]);
buf[bufIndex] = 0;
IncrementLineNumber();
errBuf.Printf(_T("Line %lu of file %s is too long. Lines can be no longer than %lu characters. Truncated."),
LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str(),MAX_LINE_BUFFER_SIZE);
OnError((wxChar *)errBuf.c_str());
- return FALSE;
+ return false;
}
wxStrcat(buf, _T("\\par"));
bufIndex += 5;
errBuf.Printf(_T("Line %lu of file %s is too long. Lines can be no longer than %lu characters. Truncated."),
LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str(),MAX_LINE_BUFFER_SIZE);
OnError((wxChar *)errBuf.c_str());
- return FALSE;
+ return false;
}
- buf[bufIndex] = ch;
+ buf[bufIndex] = (wxChar)ch;
bufIndex ++;
}
}
case 0xfc: // ü
case 0xd6: // Ö
case 0xc4: // Ä
- case 0xdc: // Ü
+ case 0xdc: // Ü
if (bufIndex+5 >= MAX_LINE_BUFFER_SIZE)
{
wxString errBuf;
errBuf.Printf(_T("Line %lu of file %s is too long. Lines can be no longer than %lu characters. Truncated."),
LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str(),MAX_LINE_BUFFER_SIZE);
OnError((wxChar *)errBuf.c_str());
- return FALSE;
+ return false;
}
buf[bufIndex++]='\\';
buf[bufIndex++]='"';
case 0xfc:buf[bufIndex++]='u';break; // ü
case 0xd6:buf[bufIndex++]='O';break; // Ö
case 0xc4:buf[bufIndex++]='A';break; // Ä
- case 0xdc:buf[bufIndex++]='U';break; // Ü
- }
+ case 0xdc:buf[bufIndex++]='U';break; // Ü
+ }
buf[bufIndex++]='}';
break;
- case 0xdf: // ß
+ case 0xdf: // ß
if (bufIndex+5 >= MAX_LINE_BUFFER_SIZE)
{
wxString errBuf;
errBuf.Printf(_T("Line %lu of file %s is too long. Lines can be no longer than %lu characters. Truncated."),
LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str(),MAX_LINE_BUFFER_SIZE);
OnError((wxChar *)errBuf.c_str());
- return FALSE;
+ return false;
}
buf[bufIndex++]='\\';
buf[bufIndex++]='s';
buf[bufIndex++]='s';
buf[bufIndex++]='\\';
buf[bufIndex++]='/';
- break;
+ break;
default:
if (bufIndex >= MAX_LINE_BUFFER_SIZE)
{
errBuf.Printf(_T("Line %lu of file %s is too long. Lines can be no longer than %lu characters. Truncated."),
LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str(),MAX_LINE_BUFFER_SIZE);
OnError((wxChar *)errBuf.c_str());
- return FALSE;
+ return false;
}
- // If the current character read in is a '_', we need to check
+ // If the current character read in is a '_', we need to check
// whether there should be a '\' before it or not
if (ch != '_')
{
- buf[bufIndex++] = ch;
+ buf[bufIndex++] = (wxChar)ch;
break;
}
// There should NOT be a '\' before the '_'
if ((bufIndex > 0 && (buf[bufIndex-1] == '\\')) && (buf[0] != '%'))
{
- wxString errBuf;
- errBuf.Printf(_T("An underscore ('_') was detected at line %lu inside file %s that should NOT have a '\\' before it."),
- LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str());
- OnError((wxChar *)errBuf.c_str());
+// wxString errBuf;
+// errBuf.Printf(_T("An underscore ('_') was detected at line %lu inside file %s that should NOT have a '\\' before it."),
+// LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str());
+// OnError((wxChar *)errBuf.c_str());
}
}
else
}
}
}
- buf[bufIndex++] = ch;
+ buf[bufIndex++] = (wxChar)ch;
break;
} // switch
} // else
buf[bufIndex] = 0;
fclose(Inputs[CurrentInputIndex]);
Inputs[CurrentInputIndex] = NULL;
- if (CurrentInputIndex > 0)
+ if (CurrentInputIndex > 0)
ch = ' '; // No real end of file
CurrentInputIndex --;
- if (checkCurleyBraces)
+ if (checkCurlyBraces)
{
- if (leftCurley != rightCurley)
+ if (leftCurly != rightCurly)
{
wxString errBuf;
- errBuf.Printf(_T("Curley braces do not match inside file %s\n%lu opens, %lu closes"),
- (const wxChar*) currentFileName.c_str(),leftCurley,rightCurley);
+ errBuf.Printf(_T("Curly braces do not match inside file %s\n%lu opens, %lu closes"),
+ (const wxChar*) currentFileName.c_str(),leftCurly,rightCurly);
OnError((wxChar *)errBuf.c_str());
}
- leftCurley = 0;
- rightCurley = 0;
+ leftCurly = 0;
+ rightCurly = 0;
}
if (readingVerbatim)
{
- readingVerbatim = FALSE;
- readInVerbatim = FALSE;
+ readingVerbatim = false;
+ readInVerbatim = false;
wxStrcat(buf, _T("\\end{verbatim}\n"));
- return FALSE;
+ return false;
}
}
if (ch == 10)
j -= 5;
buf[j] = 0;
}
-
+
if (buf[j-1] == '}')
buf[j-1] = 0; // Ignore final brace
}
else
{
- readingVerbatim = TRUE;
- readInVerbatim = TRUE;
+ readingVerbatim = true;
+ readInVerbatim = true;
wxStrcpy(buf, _T("\\begin{verbatim}\n"));
- return FALSE;
+ return false;
}
}
- return FALSE;
+ return false;
}
else if (wxStrncmp(buf, _T("\\input"), 6) == 0 || wxStrncmp(buf, _T("\\helpinput"), 10) == 0 ||
wxStrncmp(buf, _T("\\include"), 8) == 0)
buf[j] = 0;
}
- if (buf[j-1] == _T('}'))
+ if (buf[j-1] == _T('}'))
buf[j-1] = 0; // Ignore final brace
// Remove backslashes from name
if (actualFile == _T(""))
{
wxChar buf2[400];
- wxSprintf(buf2, _T("%s.tex"), fileNameStr.c_str());
+ wxSnprintf(buf2, sizeof(buf2), _T("%s.tex"), fileNameStr.c_str());
actualFile = TexPathList.FindValidPath(buf2);
}
currentFileName = actualFile;
if (checkSyntax)
{
wxString bufStr = buf;
- for (int index=0; syntaxTokens[index] != wxEmptyString; index++)
+ for (int index=0; !syntaxTokens[index].empty(); index++)
{
size_t pos = bufStr.find(syntaxTokens[index]);
if (pos != wxString::npos && pos != 0)
if (wxStrncmp(buf, _T("\\begin{verbatim}"), 16) == 0 ||
wxStrncmp(buf, _T("\\begin{toocomplex}"), 18) == 0)
- readInVerbatim = TRUE;
+ readInVerbatim = true;
else if (wxStrncmp(buf, _T("\\end{verbatim}"), 14) == 0 ||
wxStrncmp(buf, _T("\\end{toocomplex}"), 16) == 0)
- readInVerbatim = FALSE;
+ readInVerbatim = false;
- if (checkCurleyBraces)
+ if (checkCurlyBraces)
{
- if (ch == EOF && leftCurley != rightCurley)
+ if (ch == EOF && leftCurly != rightCurly)
{
wxString errBuf;
- errBuf.Printf(_T("Curley braces do not match inside file %s\n%lu opens, %lu closes"),
- (const wxChar*) currentFileName.c_str(),leftCurley,rightCurley);
+ errBuf.Printf(_T("Curly braces do not match inside file %s\n%lu opens, %lu closes"),
+ (const wxChar*) currentFileName.c_str(),leftCurly,rightCurly);
OnError((wxChar *)errBuf.c_str());
}
}
noArgs = (int)(buffer[*pos]) - 48;
*pos += 2; // read past argument and '['
}
- bool end = FALSE;
+ bool end = false;
int braceCount = 0;
while (!end)
{
- char ch = buffer[*pos];
+ wxChar ch = buffer[*pos];
if (ch == _T('{'))
braceCount ++;
else if (ch == _T('}'))
{
braceCount --;
if (braceCount == 0)
- end = TRUE;
+ end = true;
}
else if (ch == 0)
{
CustomMacroList.Append(commandName, macro);
AddMacroDef(ltCUSTOM_MACRO, commandName, noArgs);
}
- return TRUE;
+ return true;
}
- else return FALSE;
+ else return false;
}
void MacroError(wxChar *buffer)
wxChar macroBuf[200];
macroBuf[0] = '\\';
int i = 1;
- char ch;
+ wxChar ch;
while (((ch = buffer[i-1]) != '\n') && (ch != 0))
{
macroBuf[i] = ch;
if (wxStrcmp(macroBuf,_T("\\end{document}")) == 0)
{
OnInform( _T("Halted build due to unrecoverable error.") );
- stopRunning = TRUE;
+ stopRunning = true;
}
}
* Parse an argument.
* 'environment' specifies the name of the macro IFF if we're looking for the end
* of an environment, e.g. \end{itemize}. Otherwise it's NULL.
- * 'parseToBrace' is TRUE if the argument should extend to the next right brace,
+ * 'parseToBrace' is true if the argument should extend to the next right brace,
* e.g. in {\bf an argument} as opposed to \vskip 30pt
*
*/
{
Tex2RTFYield();
if (stopRunning) return pos;
-
- bool eof = FALSE;
+
+ bool eof = false;
BigBuffer[0] = 0;
int buf_ptr = 0;
int len;
if ((pos > 0) && (buffer[pos-1] != ' ') && (buffer[pos] == '[' || buffer[pos] == '('))
{
- isOptional = TRUE;
+ isOptional = true;
pos ++;
}
else if ((pos > 1) && (buffer[pos-1] != ' ') && (buffer[pos+1] == '[' || buffer[pos+1] == '('))
{
- isOptional = TRUE;
+ isOptional = true;
pos += 2;
}
}
*/
-
+
// If not parsing to brace, just read the next word
// (e.g. \vskip 20pt)
if (!parseToBrace)
while (!eof && ch != 13 && ch != 32 && ch != 10 &&
ch != 0 && ch != '{')
{
- BigBuffer[buf_ptr] = ch;
+ BigBuffer[buf_ptr] = (wxChar)ch;
buf_ptr ++;
pos ++;
ch = buffer[pos];
}
}
- 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
{
children.Append((wxObject *)chunk);
}
pos ++;
-
+
// Try matching \end{environment}
if (environment && FindEndEnvironment(buffer, &pos, environment))
{
wxTex2RTFBuffer[0] = 0;
int i = 0;
- bool end = FALSE;
+ bool end = false;
while (!end)
{
- int ch = buffer[pos];
- if (ch == '}')
+ wxChar ch = buffer[pos];
+ if (ch == _T('}'))
{
noBraces --;
if (noBraces == 0)
{
wxTex2RTFBuffer[i] = 0;
- end = TRUE;
+ end = true;
}
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++;
}
pos ++;
i ++;
if (ch == 0)
- end = TRUE;
+ end = true;
}
}
TexChunk *chunk = new TexChunk(CHUNK_TYPE_MACRO);
else if (wxStrncmp(buffer+pos, _T("verb"), 4) == 0)
{
pos += 4;
- if (buffer[pos] == '*')
+ if (buffer[pos] == _T('*'))
pos ++;
- // Find the delimiter character
- int ch = buffer[pos];
+ // Find the delimiter character
+ wxChar ch = buffer[pos];
pos ++;
// Now at start of verbatim text
int j = pos;
children.Append((wxObject *)chunk);
}
- else
- {
+ else
+ {
wxChar *env = NULL;
- bool tmpParseToBrace = TRUE;
+ bool tmpParseToBrace = true;
TexMacroDef *def = MatchMacro(buffer, &pos, &env, &tmpParseToBrace);
if (def)
{
// wxStrcpy(macroBuf, _T("{"));
wxStrcpy(macroBuf, customMacro->macroBody);
wxStrcat(macroBuf, _T("}"));
- ParseArg(thisArg, children, macroBuf, 0, NULL, TRUE, chunk);
+ ParseArg(thisArg, children, macroBuf, 0, NULL, true, chunk);
}
-
+
// delete chunk; // Might delete children
}
}
}
// 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)
{
children.Append((wxObject *)chunk);
pos = ParseMacroBody(def->name, chunk, chunk->no_args,
- buffer, pos, NULL, TRUE, customMacroArgs);
+ buffer, pos, NULL, true, customMacroArgs);
// If custom macro, parse the body substituting the above found args.
if (customMacro)
// wxStrcpy(macroBuf, _T("{"));
wxStrcpy(macroBuf, customMacro->macroBody);
wxStrcat(macroBuf, _T("}"));
- ParseArg(thisArg, children, macroBuf, 0, NULL, TRUE, chunk);
+ ParseArg(thisArg, children, macroBuf, 0, NULL, true, chunk);
}
-
+
// delete chunk; // Might delete children
}
}
}
}
else
- {
+ {
/*
* If all else fails, we assume that we have
* a pair of braces on their own, so return a `dummy' macro
*/
if (!SoloBlockDef)
{
- SoloBlockDef = new TexMacroDef(ltSOLO_BLOCK, _T("solo block"), 1, FALSE);
+ SoloBlockDef = new TexMacroDef(ltSOLO_BLOCK, _T("solo block"), 1, false);
}
// Save text so far
if (buf_ptr > 0)
arg->argn = 1;
arg->macroId = chunk->macroId;
- pos = ParseArg(arg, arg->children, buffer, pos, NULL, TRUE, customMacroArgs);
- }
+ 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 ++;
* Consume as many arguments as the macro definition specifies
*
*/
-
+
int ParseMacroBody(const wxChar *WXUNUSED(macro_name), TexChunk *parent,
int no_args, wxChar *buffer, int pos,
wxChar *environment, bool parseToBrace,
else
actualEnv = environment;
- bool isOptional = FALSE;
+ bool isOptional = false;
// Remove the first { of the argument so it doesn't get recognized as { ... }
// EatWhiteSpace(buffer, &pos);
else
if ((pos > 0) && (buffer[pos-1] != ' ') && (buffer[pos] == '['))
{
- isOptional = TRUE;
+ isOptional = true;
pos ++;
}
else if ((pos > 1) && (buffer[pos-1] != ' ') && (buffer[pos+1] == '['))
{
- isOptional = TRUE;
+ isOptional = true;
pos += 2;
}
else if (i > 0)
bool TexLoadFile(wxChar *filename)
{
static wxChar *line_buffer;
- stopRunning = FALSE;
+ stopRunning = false;
wxStrcpy(TexFileRoot, filename);
StripExtension(TexFileRoot);
- wxSprintf(TexBibName, _T("%s.bb"), TexFileRoot);
- wxSprintf(TexTmpBibName, _T("%s.bb1"), TexFileRoot);
+ wxSnprintf(TexBibName, 300, _T("%s.bb"), TexFileRoot);
+ wxSnprintf(TexTmpBibName, 300, _T("%s.bb1"), TexFileRoot);
TexPathList.EnsureFileAccessible(filename);
- if (line_buffer)
+ if (line_buffer)
delete line_buffer;
line_buffer = new wxChar[MAX_LINE_BUFFER_SIZE];
-
+
Inputs[0] = wxFopen(filename, _T("r"));
LineNumbers[0] = 1;
FileNames[0] = copystring(filename);
if (Inputs[0])
{
read_a_line(line_buffer);
- ParseMacroBody(_T("toplevel"), TopLevel, 1, line_buffer, 0, NULL, TRUE);
+ ParseMacroBody(_T("toplevel"), TopLevel, 1, line_buffer, 0, NULL, true);
if (Inputs[0]) fclose(Inputs[0]);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
TexMacroDef::TexMacroDef(int the_id, const wxChar *the_name, int n, bool ig, bool forbidLevel)
def = the_def;
macroId = 0;
value = NULL;
- optional = FALSE;
+ optional = false;
}
TexChunk::TexChunk(TexChunk& toCopy)
no_args = toCopy.no_args;
argn = toCopy.argn;
macroId = toCopy.macroId;
-
+
// if (toCopy.name)
// name = copystring(toCopy.name);
// else
value = copystring(toCopy.value);
else
value = NULL;
-
+
optional = toCopy.optional;
wxNode *node = toCopy.children.GetFirst();
while (node)
* only!)
*
*/
-
+
void GetArgData1(TexChunk *chunk)
{
switch (chunk->type)
{
currentArgData[0] = 0;
GetArgData1(currentArgument);
- haveArgData = FALSE;
+ haveArgData = false;
return currentArgData;
}
return;
if (!childrenOnly)
- OnMacro(chunk->macroId, chunk->no_args, TRUE);
+ OnMacro(chunk->macroId, chunk->no_args, true);
wxNode *node = chunk->children.GetFirst();
while (node)
nextChunk = (TexChunk *)thisNode->GetNext()->GetData();
if (!childrenOnly)
- OnMacro(chunk->macroId, chunk->no_args, FALSE);
+ OnMacro(chunk->macroId, chunk->no_args, false);
break;
}
case CHUNK_TYPE_ARG:
isArgOptional = chunk->optional;
noArgs = chunk->no_args;
- // If OnArgument returns FALSE, don't output.
+ // If OnArgument returns false, don't output.
- if (childrenOnly || OnArgument(chunk->macroId, chunk->argn, TRUE))
+ if (childrenOnly || OnArgument(chunk->macroId, chunk->argn, true))
{
wxNode *node = chunk->children.GetFirst();
while (node)
noArgs = chunk->no_args;
if (!childrenOnly)
- (void)OnArgument(chunk->macroId, chunk->argn, FALSE);
+ (void)OnArgument(chunk->macroId, chunk->argn, false);
break;
}
case CHUNK_TYPE_STRING:
if (issuedNewParagraph && !((chunk->value[0] == 10 || chunk->value[0] == 13 || chunk->value[0] == 32)
&& chunk->value[1] == 0))
{
- issuedNewParagraph = FALSE;
+ issuedNewParagraph = false;
}
- TexOutput(chunk->value, TRUE);
+ TexOutput(chunk->value, true);
}
break;
}
CurrentOutput1 = NULL;
CurrentOutput2 = NULL;
CurrentInputIndex = 0;
- haveArgData = FALSE;
+ haveArgData = false;
noArgs = 0;
if (TopLevel)
}
/**/
TexReferences.BeginFind();
- wxNode *node = TexReferences.Next();
- while (node)
+ wxHashTable::Node *refNode = TexReferences.Next();
+ while (refNode)
{
- TexRef *ref = (TexRef *)node->GetData();
+ TexRef *ref = (TexRef *)refNode->GetData();
delete ref;
- node = TexReferences.Next();
+ refNode = TexReferences.Next();
}
TexReferences.Clear();
-
- node = BibList.GetFirst();
- while (node)
+
+ wxNode* bibNode = BibList.GetFirst();
+ while (bibNode)
{
- BibEntry *entry = (BibEntry *)node->GetData();
+ BibEntry *entry = (BibEntry *)bibNode->GetData();
delete entry;
- delete node;
- node = BibList.GetFirst();
+ delete bibNode;
+ bibNode = BibList.GetFirst();
}
CitationList.Clear();
ResetTopicCounter();
AddMacroDef(ltCLIPSFUNC, _T("clipsfunc"), 3);
AddMacroDef(ltCLUBSUIT, _T("clubsuit"), 0);
AddMacroDef(ltCOLUMNSEP, _T("columnsep"), 1);
- AddMacroDef(ltCOMMENT, _T("comment"), 1, TRUE);
+ AddMacroDef(ltCOMMENT, _T("comment"), 1, true);
AddMacroDef(ltCONG, _T("cong"), 0);
AddMacroDef(ltCOPYRIGHT, _T("copyright"), 0);
AddMacroDef(ltCPARAM, _T("cparam"), 2);
AddMacroDef(ltHEADHEIGHT, _T("headheight"), 1);
AddMacroDef(ltHEARTSUIT, _T("heartsuit"), 0);
AddMacroDef(ltHELPGLOSSARY, _T("helpglossary"), 1);
- AddMacroDef(ltHELPIGNORE, _T("helpignore"), 1, TRUE);
+ AddMacroDef(ltHELPIGNORE, _T("helpignore"), 1, true);
AddMacroDef(ltHELPONLY, _T("helponly"), 1);
AddMacroDef(ltHELPINPUT, _T("helpinput"), 1);
AddMacroDef(ltHELPFONTFAMILY, _T("helpfontfamily"), 1);
AddMacroDef(ltINCLUDE, _T("include"), 1);
AddMacroDef(ltINDENTED, _T("indented"), 2);
AddMacroDef(ltINDEX, _T("index"), 1);
- AddMacroDef(ltINPUT, _T("input"), 1, TRUE);
+ AddMacroDef(ltINPUT, _T("input"), 1, true);
AddMacroDef(ltIOTA, _T("iota"), 0);
AddMacroDef(ltITEMIZE, _T("itemize"), 1);
AddMacroDef(ltITEM, _T("item"), 0);
AddMacroDef(ltNABLA, _T("nabla"), 0);
AddMacroDef(ltNEG, _T("neg"), 0);
AddMacroDef(ltNEQ, _T("neq"), 0);
- AddMacroDef(ltNEWCOUNTER, _T("newcounter"), 1, FALSE, (bool)FORBID_ABSOLUTELY);
+ AddMacroDef(ltNEWCOUNTER, _T("newcounter"), 1, false, (bool)FORBID_ABSOLUTELY);
AddMacroDef(ltNEWLINE, _T("newline"), 0);
AddMacroDef(ltNEWPAGE, _T("newpage"), 0);
AddMacroDef(ltNI, _T("ni"), 0);
AddMacroDef(ltPRECEQ, _T("preceq"), 0);
AddMacroDef(ltPRINTINDEX, _T("printindex"), 0);
AddMacroDef(ltPROPTO, _T("propto"), 0);
- AddMacroDef(ltPSBOXTO, _T("psboxto"), 1, FALSE, (bool)FORBID_ABSOLUTELY);
- AddMacroDef(ltPSBOX, _T("psbox"), 1, FALSE, (bool)FORBID_ABSOLUTELY);
+ AddMacroDef(ltPSBOXTO, _T("psboxto"), 1, false, (bool)FORBID_ABSOLUTELY);
+ AddMacroDef(ltPSBOX, _T("psbox"), 1, false, (bool)FORBID_ABSOLUTELY);
AddMacroDef(ltPSI, _T("psi"), 0);
AddMacroDef(ltCAP_PSI, _T("Psi"), 0);
AddMacroDef(ltSUPSET, _T("supset"), 0);
AddMacroDef(ltSUBSUBSECTIONSTAR, _T("subsubsection*"), 1);
AddMacroDef(ltSUBSUBSECTION, _T("subsubsection"), 1);
- AddMacroDef(ltSUPERTABULAR, _T("supertabular"), 2, FALSE);
+ AddMacroDef(ltSUPERTABULAR, _T("supertabular"), 2, false);
AddMacroDef(ltSURD, _T("surd"), 0);
AddMacroDef(ltSCRIPTSIZE, _T("scriptsize"), 1);
AddMacroDef(ltSETHEADER, _T("setheader"), 6);
AddMacroDef(ltTABBING, _T("tabbing"), 2);
AddMacroDef(ltTABLEOFCONTENTS, _T("tableofcontents"), 0);
AddMacroDef(ltTABLE, _T("table"), 1);
- AddMacroDef(ltTABULAR, _T("tabular"), 2, FALSE);
+ AddMacroDef(ltTABULAR, _T("tabular"), 2, false);
AddMacroDef(ltTAB, _T("tab"), 0);
AddMacroDef(ltTAU, _T("tau"), 0);
AddMacroDef(ltTEXTRM, _T("textrm"), 1);
AddMacroDef(ltUPSHAPE, _T("upshape"), 1);
AddMacroDef(ltURLREF, _T("urlref"), 2);
AddMacroDef(ltUSEPACKAGE, _T("usepackage"), 1);
-
+
AddMacroDef(ltVAREPSILON, _T("varepsilon"), 0);
AddMacroDef(ltVARPHI, _T("varphi"), 0);
AddMacroDef(ltVARPI, _T("varpi"), 0);
* Default behaviour, should be called by client if can't match locally.
*
*/
-
+
// Called on start/end of macro examination
void DefaultOnMacro(int macroId, int no_args, bool start)
{
{
// Write the heading
FakeCurrentSection(AbstractNameString);
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
}
else
{
{
// Write the heading
FakeCurrentSection(GlossaryNameString);
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
if ((convertMode == TEX_RTF) && !winHelp)
{
- OnMacro(ltPAR, 0, TRUE);
- OnMacro(ltPAR, 0, FALSE);
+ OnMacro(ltPAR, 0, true);
+ OnMacro(ltPAR, 0, false);
}
}
break;
case ltCINSERT:
if (start)
- TexOutput(_T("<<"), TRUE);
+ TexOutput(_T("<<"), true);
break;
case ltCEXTRACT:
if (start)
- TexOutput(_T(">>"), TRUE);
+ TexOutput(_T(">>"), true);
break;
case ltDESTRUCT:
if (start)
- TexOutput(_T("~"), TRUE);
+ TexOutput(_T("~"), true);
break;
case ltTILDE:
if (start)
- TexOutput(_T("~"), TRUE);
+ TexOutput(_T("~"), true);
break;
case ltSPECIALTILDE:
if (start)
- TexOutput(_T(" "), TRUE);
+ TexOutput(_T(" "), true);
break;
case ltUNDERSCORE:
if (start)
- TexOutput(_T("_"), TRUE);
+ TexOutput(_T("_"), true);
break;
case ltHASH:
if (start)
- TexOutput(_T("#"), TRUE);
+ TexOutput(_T("#"), true);
break;
case ltAMPERSAND:
if (start)
- TexOutput(_T("&"), TRUE);
+ TexOutput(_T("&"), true);
break;
case ltSPACE:
if (start)
- TexOutput(_T(" "), TRUE);
+ TexOutput(_T(" "), true);
break;
case ltPIPE:
if (start)
- TexOutput(_T("|"), TRUE);
+ TexOutput(_T("|"), true);
break;
case ltPERCENT:
if (start)
- TexOutput(_T("%"), TRUE);
+ TexOutput(_T("%"), true);
break;
case ltDOLLAR:
if (start)
- TexOutput(_T("$"), TRUE);
+ TexOutput(_T("$"), true);
break;
case ltLPARENTH:
if (start)
- TexOutput(_T(""), TRUE);
+ TexOutput(_T(""), true);
break;
case ltRPARENTH:
if (start)
- TexOutput(_T(""), TRUE);
+ TexOutput(_T(""), true);
break;
case ltLBRACE:
if (start)
- TexOutput(_T("{"), TRUE);
+ TexOutput(_T("{"), true);
break;
case ltRBRACE:
if (start)
- TexOutput(_T("}"), TRUE);
+ TexOutput(_T("}"), true);
break;
case ltCOPYRIGHT:
if (start)
- TexOutput(_T("(c)"), TRUE);
+ TexOutput(_T("(c)"), true);
break;
case ltREGISTERED:
if (start)
- TexOutput(_T("(r)"), TRUE);
+ TexOutput(_T("(r)"), true);
break;
case ltBACKSLASH:
- if (start)
- TexOutput(_T("\\"), TRUE);
+ if (start)
+ TexOutput(_T("\\"), true);
break;
case ltLDOTS:
case ltCDOTS:
if (start)
- TexOutput(_T("..."), TRUE);
+ TexOutput(_T("..."), true);
break;
case ltVDOTS:
if (start)
- TexOutput(_T("|"), TRUE);
+ TexOutput(_T("|"), true);
break;
case ltLATEX:
if (start)
- TexOutput(_T("LaTeX"), TRUE);
+ TexOutput(_T("LaTeX"), true);
break;
case ltTEX:
if (start)
- TexOutput(_T("TeX"), TRUE);
+ TexOutput(_T("TeX"), true);
break;
case ltPOUNDS:
if (start)
- TexOutput(_T("£"), TRUE);
+ // FIXME: this is valid only if the output is iso-8859-1
+ TexOutput(wxString::FromAscii("£"), true);
break;
case ltSPECIALDOUBLEDOLLAR: // Interpret as center
OnMacro(ltCENTER, no_args, start);
{
time_t when;
(void) time(&when);
- TexOutput(wxCtime(&when), TRUE);
+ TexOutput(wxCtime(&when), true);
}
break;
}
else i ++;
}
}
- TexOutput(texRef->sectionNumber + i, TRUE);
+ TexOutput(texRef->sectionNumber + i, true);
}
else
{
wxString informBuf;
- informBuf.Printf(_T("Warning: unresolved reference '%s'"), refName);
+ informBuf.Printf(_T("Warning: unresolved reference '%s'"), refName);
OnInform((wxChar *)informBuf.c_str());
}
}
- else TexOutput(_T("??"), TRUE);
- return FALSE;
+ else TexOutput(_T("??"), true);
+ return false;
}
break;
}
case ltLABEL:
{
- return FALSE;
+ return false;
}
case ltAUTHOR:
{
if (start && (arg_no == 1))
DocumentAuthor = GetArgChunk();
- return FALSE;
+ return false;
}
case ltDATE:
{
if (start && (arg_no == 1))
DocumentDate = GetArgChunk();
- return FALSE;
+ return false;
}
case ltTITLE:
{
if (start && (arg_no == 1))
DocumentTitle = GetArgChunk();
- return FALSE;
+ return false;
}
case ltDOCUMENTCLASS:
case ltDOCUMENTSTYLE:
DocumentStyle = LATEX_LETTER;
else if (wxStrncmp(DocumentStyleString, _T("slides"), 6) == 0)
DocumentStyle = LATEX_SLIDES;
-
+
if (StringMatch(_T("10"), DocumentStyleString))
SetFontSizes(10);
else if (StringMatch(_T("11"), DocumentStyleString))
else if (StringMatch(_T("12"), DocumentStyleString))
SetFontSizes(12);
- OnMacro(ltHELPFONTSIZE, 1, TRUE);
- wxSprintf(currentArgData, _T("%d"), normalFont);
- haveArgData = TRUE;
- OnArgument(ltHELPFONTSIZE, 1, TRUE);
- OnArgument(ltHELPFONTSIZE, 1, FALSE);
- haveArgData = FALSE;
- OnMacro(ltHELPFONTSIZE, 1, FALSE);
+ OnMacro(ltHELPFONTSIZE, 1, true);
+ wxSnprintf(currentArgData, 2000, _T("%d"), normalFont);
+ haveArgData = true;
+ OnArgument(ltHELPFONTSIZE, 1, true);
+ OnArgument(ltHELPFONTSIZE, 1, false);
+ haveArgData = false;
+ OnMacro(ltHELPFONTSIZE, 1, false);
}
else if (start && IsArgOptional())
{
else if (StringMatch(_T("12"), MinorDocumentStyleString))
SetFontSizes(12);
}
- return FALSE;
+ return false;
}
case ltBIBLIOGRAPHYSTYLE:
{
if (start && !IsArgOptional())
BibliographyStyleString = copystring(GetArgData());
- return FALSE;
+ return false;
}
case ltPAGESTYLE:
{
if (PageStyle) delete[] PageStyle;
PageStyle = copystring(GetArgData());
}
- return FALSE;
+ return false;
}
/*
case ltLHEAD:
{
if (start && !IsArgOptional())
LeftHeader = GetArgChunk();
- return FALSE;
+ return false;
break;
}
case ltLFOOT:
{
if (start && !IsArgOptional())
LeftFooter = GetArgChunk();
- return FALSE;
+ return false;
break;
}
case ltCHEAD:
{
if (start && !IsArgOptional())
CentreHeader = GetArgChunk();
- return FALSE;
+ return false;
break;
}
case ltCFOOT:
{
if (start && !IsArgOptional())
CentreFooter = GetArgChunk();
- return FALSE;
+ return false;
break;
}
case ltRHEAD:
{
if (start && !IsArgOptional())
RightHeader = GetArgChunk();
- return FALSE;
+ return false;
break;
}
case ltRFOOT:
{
if (start && !IsArgOptional())
RightFooter = GetArgChunk();
- return FALSE;
+ return false;
break;
}
*/
TexRef *ref = FindReference(citeKey);
if (ref)
{
- TexOutput(ref->sectionNumber, TRUE);
+ TexOutput(ref->sectionNumber, true);
if (wxStrcmp(ref->sectionNumber, _T("??")) == 0)
{
wxString informBuf;
citeKey = ParseMultifieldString(citeKeys, &pos);
if (citeKey)
{
- TexOutput(_T(", "), TRUE);
+ TexOutput(_T(", "), true);
}
}
- return FALSE;
+ return false;
}
break;
}
{
wxChar *citeKey = GetArgData();
AddCitation(citeKey);
- return FALSE;
+ return false;
}
break;
}
SetFontSizes(11);
else if (wxStrcmp(data, _T("12")) == 0)
SetFontSizes(12);
- return FALSE;
+ return false;
}
break;
}
{
if (start)
{
- TexOutput(_T(" ??"), TRUE);
- return FALSE;
+ TexOutput(_T(" ??"), true);
+ return false;
}
break;
}
{
wxChar *data = GetArgData();
ParSkip = ParseUnitArgument(data);
- return FALSE;
+ return false;
}
break;
}
{
wxChar *data = GetArgData();
ParIndent = ParseUnitArgument(data);
- return FALSE;
+ return false;
}
break;
}
case ltFOOTNOTE:
{
if (start)
- TexOutput(_T(" ("), TRUE);
+ TexOutput(_T(" ("), true);
else
- TexOutput(_T(")"), TRUE);
+ TexOutput(_T(")"), true);
break;
}
case ltBIBLIOGRAPHY:
if (fd)
{
ch = getc(fd);
- smallBuf[0] = ch;
+ smallBuf[0] = (wxChar)ch;
while (ch != EOF)
{
TexOutput(smallBuf);
ch = getc(fd);
- smallBuf[0] = ch;
+ smallBuf[0] = (wxChar)ch;
}
fclose(fd);
}
wxRenameFile(TexTmpBibName, TexBibName);
}
SetCurrentOutputs(save1, save2);
- return FALSE;
+ return false;
}
break;
}
wxChar *s1 = copystring(s);
int i;
for (i = 0; i < (int)wxStrlen(s); i++)
- s1[i] = wxToupper(s[i]);
+ s1[i] = (wxChar)wxToupper(s[i]);
TexOutput(s1);
delete[] s1;
- return FALSE;
+ return false;
}
- else return TRUE;
+ else return true;
}
- return TRUE;
+ return true;
}
case ltLOWERCASE:
{
wxChar *s1 = copystring(s);
int i;
for (i = 0; i < (int)wxStrlen(s); i++)
- s1[i] = wxTolower(s[i]);
+ s1[i] = (wxChar)wxTolower(s[i]);
TexOutput(s1);
delete[] s1;
- return FALSE;
+ return false;
}
- else return TRUE;
+ else return true;
}
- return TRUE;
+ return true;
}
case ltUPPERCASE:
{
wxChar *s1 = copystring(s);
int i;
for (i = 0; i < (int)wxStrlen(s); i++)
- s1[i] = wxToupper(s[i]);
+ s1[i] = (wxChar)wxToupper(s[i]);
TexOutput(s1);
delete[] s1;
- return FALSE;
+ return false;
}
- else return TRUE;
+ else return true;
}
- return TRUE;
+ return true;
}
case ltPOPREF: // Ignore second argument by default
return (start && (arg_no == 1));
case ltTWOCOLUMN:
- return TRUE;
+ return true;
case ltXLPIGNORE:
- return ((convertMode == TEX_XLP) ? FALSE : TRUE);
+ return ((convertMode == TEX_XLP) ? false : true);
case ltXLPONLY:
- return ((convertMode != TEX_XLP) ? FALSE : TRUE);
+ return ((convertMode != TEX_XLP) ? false : true);
case ltHTMLIGNORE:
- return ((convertMode == TEX_HTML) ? FALSE : TRUE);
+ return ((convertMode == TEX_HTML) ? false : true);
case ltHTMLONLY:
- return ((convertMode != TEX_HTML) ? FALSE : TRUE);
+ return ((convertMode != TEX_HTML) ? false : true);
case ltRTFIGNORE:
- return (((convertMode == TEX_RTF) && !winHelp) ? FALSE : TRUE);
+ return (((convertMode == TEX_RTF) && !winHelp) ? false : true);
case ltRTFONLY:
- return (!((convertMode == TEX_RTF) && !winHelp) ? FALSE : TRUE);
+ return (!((convertMode == TEX_RTF) && !winHelp) ? false : true);
case ltWINHELPIGNORE:
- return (winHelp ? FALSE : TRUE);
+ return (winHelp ? false : true);
case ltWINHELPONLY:
- return (!winHelp ? FALSE : TRUE);
+ return (!winHelp ? false : true);
case ltLATEXIGNORE:
- return TRUE;
+ return true;
case ltLATEXONLY:
- return FALSE;
+ return false;
case ltCLINE:
case ltARABIC:
case ltALPH1:
case ltIMAGER:
case ltPOPREFONLY:
case ltINSERTATLEVEL:
- return FALSE;
+ return false;
case ltTABULAR:
case ltSUPERTABULAR:
case ltINDENTED:
break;
}
}
- return FALSE;
+ return false;
}
case ltFIGURE:
case ltFIGURESTAR:
default:
return (!IsArgOptional());
}
- return TRUE;
+ return true;
}