X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3924dd226e469685d02fc2474a3fb149b1aeed2a..4b04699b670b4ab4632229fa0264d154acd3bec1:/utils/tex2rtf/src/texutils.cpp?ds=sidebyside diff --git a/utils/tex2rtf/src/texutils.cpp b/utils/tex2rtf/src/texutils.cpp index f3c25d42b7..ef76580db1 100644 --- a/utils/tex2rtf/src/texutils.cpp +++ b/utils/tex2rtf/src/texutils.cpp @@ -24,7 +24,11 @@ #include "wx/wx.h" #endif -#include +#include "wx/hash.h" + +#ifdef new +#undef new +#endif #if wxUSE_IOSTREAMH #include @@ -146,7 +150,7 @@ void ResetTopicCounter(void) static char *forceTopicName = NULL; -void ForceTopicName(char *name) +void ForceTopicName(const char *name) { if (forceTopicName) delete[] forceTopicName; @@ -378,7 +382,7 @@ void AddTexRef(char *name, char *file, char *sectionName, void WriteTexReferences(char *filename) { - ofstream ostr(filename); + wxSTD ofstream ostr(filename); if (ostr.bad()) return; char buf[200]; @@ -405,7 +409,7 @@ void ReadTexReferences(char *filename) if (!wxFileExists(filename)) return; - ifstream istr(filename, ios::in); + wxSTD ifstream istr(filename, ios::in); if (istr.bad()) return; @@ -450,7 +454,7 @@ void ReadTexReferences(char *filename) * */ -void BibEatWhiteSpace(istream& str) +void BibEatWhiteSpace(wxSTD istream& str) { char ch = str.peek(); @@ -478,7 +482,7 @@ void BibEatWhiteSpace(istream& str) } // Read word up to { or , or space -void BibReadWord(istream& istr, char *buffer) +void BibReadWord(wxSTD istream& istr, char *buffer) { int i = 0; buffer[i] = 0; @@ -495,7 +499,7 @@ void BibReadWord(istream& istr, char *buffer) } // Read string (double-quoted or not) to end quote or EOL -void BibReadToEOL(istream& istr, char *buffer) +void BibReadToEOL(wxSTD istream& istr, char *buffer) { int i = 0; buffer[i] = 0; @@ -524,7 +528,7 @@ void BibReadToEOL(istream& istr, char *buffer) } // Read }-terminated value, taking nested braces into account. -void BibReadValue(istream& istr, char *buffer, bool ignoreBraces = TRUE, +void BibReadValue(wxSTD istream& istr, char *buffer, bool ignoreBraces = TRUE, bool quotesMayTerminate = TRUE) { int braceCount = 1; @@ -538,8 +542,9 @@ void BibReadValue(istream& istr, char *buffer, bool ignoreBraces = TRUE, if (i >= 4000) { char buf[100]; - sprintf(buf, "Sorry, value > 4000 chars in bib file at line %ld, terminating.", BibLine); - wxFatalError(buf, "Tex2RTF Fatal Error"); + sprintf(buf, "Sorry, value > 4000 chars in bib file at line %ld.", BibLine); + wxLogError(buf, "Tex2RTF Fatal Error"); + return; } istr.get(ch); @@ -580,7 +585,7 @@ bool ReadBib(char *filename) return FALSE; char buf[300]; - ifstream istr(filename, ios::in); + wxSTD ifstream istr(filename, ios::in); if (istr.bad()) return FALSE; BibLine = 1; @@ -1179,6 +1184,13 @@ char *RegisterSetting(char *settingName, char *settingValue, bool interactive) htmlFrameContents = StringTobool(settingValue); else if (StringMatch(settingName, "upperCaseNames", FALSE, TRUE)) upperCaseNames = StringTobool(settingValue); + else if (StringMatch(settingName, "ignoreBadRefs", FALSE, TRUE)) + ignoreBadRefs = StringTobool(settingValue); + else if (StringMatch(settingName, "htmlFaceName", FALSE, TRUE)) + { + delete[] htmlFaceName; + htmlFaceName = copystring(settingValue); + } else if (StringMatch(settingName, "winHelpTitle", FALSE, TRUE)) { if (winHelpTitle) @@ -1302,7 +1314,7 @@ bool ReadCustomMacros(char *filename) if (!wxFileExists(filename)) return FALSE; - ifstream istr(filename, ios::in); + wxSTD ifstream istr(filename, ios::in); if (istr.bad()) return FALSE; @@ -1459,7 +1471,7 @@ char *ParseMultifieldString(char *allFields, int *pos) * */ -ColourTableEntry::ColourTableEntry(char *theName, unsigned int r, unsigned int g, unsigned int b) +ColourTableEntry::ColourTableEntry(const char *theName, unsigned int r, unsigned int g, unsigned int b) { name = copystring(theName); red = r; @@ -1472,7 +1484,7 @@ ColourTableEntry::~ColourTableEntry(void) delete[] name; } -void AddColour(char *theName, unsigned int r, unsigned int g, unsigned int b) +void AddColour(const char *theName, unsigned int r, unsigned int g, unsigned int b) { wxNode *node = ColourTable.Find(theName); if (node)