X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a29912f608e082001ee53b9873323c4bcd71f21..9e5c7daa4ac39c047eee7f7a18b1489f36c7ceef:/utils/tex2rtf/src/texutils.cpp diff --git a/utils/tex2rtf/src/texutils.cpp b/utils/tex2rtf/src/texutils.cpp index 5de8abcae7..5746339422 100644 --- a/utils/tex2rtf/src/texutils.cpp +++ b/utils/tex2rtf/src/texutils.cpp @@ -402,7 +402,11 @@ void WriteTexReferences(char *filename) void ReadTexReferences(char *filename) { - ifstream istr(filename, ios::nocreate | ios::in); + if (!wxFileExists(filename)) + return; + + ifstream istr(filename, ios::in); + if (istr.bad()) return; char label[100]; @@ -565,8 +569,11 @@ void BibReadValue(istream& istr, char *buffer, bool ignoreBraces = TRUE, bool ReadBib(char *filename) { + if (!wxFileExists(filename)) + return FALSE; + char buf[300]; - ifstream istr(filename, ios::nocreate | ios::in); + ifstream istr(filename, ios::in); if (istr.bad()) return FALSE; BibLine = 1; @@ -1159,6 +1166,8 @@ char *RegisterSetting(char *settingName, char *settingValue, bool interactive) winHelpContents = StringTobool(settingValue); else if (StringMatch(settingName, "htmlIndex", FALSE, TRUE)) htmlIndex = StringTobool(settingValue); + else if (StringMatch(settingName, "htmlWorkshopFiles", FALSE, TRUE)) + htmlWorkshopFiles = StringTobool(settingValue); else if (StringMatch(settingName, "htmlFrameContents", FALSE, TRUE)) htmlFrameContents = StringTobool(settingValue); else if (StringMatch(settingName, "upperCaseNames", FALSE, TRUE)) @@ -1283,7 +1292,11 @@ char *RegisterSetting(char *settingName, char *settingValue, bool interactive) bool ReadCustomMacros(char *filename) { - ifstream istr(filename, ios::nocreate | ios::in); + if (!wxFileExists(filename)) + return FALSE; + + ifstream istr(filename, ios::in); + if (istr.bad()) return FALSE; CustomMacroList.Clear(); @@ -1626,10 +1639,10 @@ char *ConvertCase(char *s) int i; if (upperCaseNames) for (i = 0; i < len; i ++) - buf[i] = wxToUpper(s[i]); + buf[i] = toupper(s[i]); else for (i = 0; i < len; i ++) - buf[i] = wxToLower(s[i]); + buf[i] = tolower(s[i]); buf[i] = 0; return buf; }