X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6fe5318e52e09eecb6f4349a898bbd081143214..835ab90ded3dfc78f5b4b0495149a0f48095a8e0:/utils/tex2rtf/src/tex2any.cpp diff --git a/utils/tex2rtf/src/tex2any.cpp b/utils/tex2rtf/src/tex2any.cpp index 8bb9b7342f..dbc5360ba3 100644 --- a/utils/tex2rtf/src/tex2any.cpp +++ b/utils/tex2rtf/src/tex2any.cpp @@ -109,7 +109,7 @@ 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 winHelp = false; // Output in Windows Help format if true, linear otherwise bool isInteractive = false; bool runTwice = false; int convertMode = TEX_RTF; @@ -117,7 +117,7 @@ bool checkCurleyBraces = false; bool checkSyntax = false; bool headerRule = false; bool footerRule = false; -bool compatibilityMode = false; // If TRUE, maximum Latex compatibility +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 @@ -151,7 +151,7 @@ wxChar *followedLinkColourString = NULL; bool combineSubSections = false; bool htmlWorkshopFiles = false; bool ignoreBadRefs = false; -wxChar *htmlFaceName = NULL; +wxChar *htmlFaceName = NULL; extern int passNumber; @@ -204,12 +204,12 @@ int CurrentInputIndex = 0; 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; @@ -227,7 +227,7 @@ TexMacroDef *VerbatimMacroDef = 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; @@ -443,6 +443,7 @@ bool read_a_line(wxChar *buf) int ch = -2; unsigned long bufIndex = 0; buf[0] = 0; + int lastChar; while (ch != EOF && ch != 10) { @@ -459,13 +460,14 @@ bool read_a_line(wxChar *buf) ((bufIndex == 16) && (wxStrncmp(buf, _T("\\end{toocomplex}"), 16) == 0))) readInVerbatim = false; + lastChar = ch; ch = getc(Inputs[CurrentInputIndex]); if (checkCurleyBraces) { - if (ch == '{' && !readInVerbatim) + if (ch == '{' && !readInVerbatim && lastChar != _T('\\')) leftCurley++; - if (ch == '}' && !readInVerbatim) + if (ch == '}' && !readInVerbatim && lastChar != _T('\\')) { rightCurley++; if (rightCurley > leftCurley) @@ -597,10 +599,10 @@ bool read_a_line(wxChar *buf) // 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 @@ -965,7 +967,7 @@ void MacroError(wxChar *buffer) * 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 * */