X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5aa5c1e4c9150c6cacdaf6090e2ae8c496e79b6b..332b8edbdc190fcb84512c2e462cb26ff5ff21cc:/utils/tex2rtf/src/texutils.cpp?ds=sidebyside diff --git a/utils/tex2rtf/src/texutils.cpp b/utils/tex2rtf/src/texutils.cpp index f4bb11a9a9..3c159839a9 100644 --- a/utils/tex2rtf/src/texutils.cpp +++ b/utils/tex2rtf/src/texutils.cpp @@ -150,7 +150,7 @@ void ResetTopicCounter(void) static char *forceTopicName = NULL; -void ForceTopicName(char *name) +void ForceTopicName(const char *name) { if (forceTopicName) delete[] forceTopicName; @@ -409,7 +409,7 @@ void ReadTexReferences(char *filename) if (!wxFileExists(filename)) return; - wxSTD ifstream istr(filename, ios::in); + wxSTD ifstream istr(filename, wxSTD ios::in); if (istr.bad()) return; @@ -542,8 +542,9 @@ void BibReadValue(wxSTD 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); @@ -584,7 +585,7 @@ bool ReadBib(char *filename) return FALSE; char buf[300]; - wxSTD ifstream istr(filename, ios::in); + wxSTD ifstream istr(filename, wxSTD ios::in); if (istr.bad()) return FALSE; BibLine = 1; @@ -1181,8 +1182,20 @@ char *RegisterSetting(char *settingName, char *settingValue, bool interactive) htmlWorkshopFiles = StringTobool(settingValue); else if (StringMatch(settingName, "htmlFrameContents", FALSE, TRUE)) htmlFrameContents = StringTobool(settingValue); + else if (StringMatch(settingName, "htmlStylesheet", FALSE, TRUE)) + { + if (htmlStylesheet) delete[] htmlStylesheet; + htmlStylesheet = copystring(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) @@ -1306,7 +1319,7 @@ bool ReadCustomMacros(char *filename) if (!wxFileExists(filename)) return FALSE; - wxSTD ifstream istr(filename, ios::in); + wxSTD ifstream istr(filename, wxSTD ios::in); if (istr.bad()) return FALSE; @@ -1463,7 +1476,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; @@ -1476,7 +1489,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) @@ -1567,24 +1580,24 @@ void InitialiseColourTable(void) * The purpose of this is to reduce the number of times wxYield is * called, since under Windows this can slow things down. */ - -static int yieldCount = 0; void Tex2RTFYield(bool force) { #ifdef __WXMSW__ - if (isSync) - return; + static int yieldCount = 0; - if (force) - yieldCount = 0; - if (yieldCount == 0) - { - if (wxTheApp) - wxYield(); - yieldCount = 10; - } - yieldCount --; + if (isSync) + return; + + if (force) + yieldCount = 0; + if (yieldCount == 0) + { + if (wxTheApp) + wxYield(); + yieldCount = 10; + } + yieldCount --; #endif }