X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b63b07a809f9a3d22596d4971ef5c8971153823a..7714864e2f21ef69ef273f3a7c58456e365539b9:/utils/tex2rtf/src/tex2any.cpp diff --git a/utils/tex2rtf/src/tex2any.cpp b/utils/tex2rtf/src/tex2any.cpp index b7e06231a7..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 * */ @@ -2056,22 +2058,22 @@ void TexCleanUp(void) } /**/ 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();