X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eb7aa89b04707bc5334f78f5ab357fe96866e476..0a5835068c62767f4c8746ebd4d6c33638bdd9f4:/utils/tex2rtf/src/texutils.cpp diff --git a/utils/tex2rtf/src/texutils.cpp b/utils/tex2rtf/src/texutils.cpp index ea888383fe..5746339422 100644 --- a/utils/tex2rtf/src/texutils.cpp +++ b/utils/tex2rtf/src/texutils.cpp @@ -402,11 +402,11 @@ void WriteTexReferences(char *filename) void ReadTexReferences(char *filename) { -#if !wxUSE_IOSTREAMH && __WXMSW__ + if (!wxFileExists(filename)) + return; + ifstream istr(filename, ios::in); -#else - ifstream istr(filename, ios::nocreate | ios::in); -#endif + if (istr.bad()) return; char label[100]; @@ -569,12 +569,11 @@ void BibReadValue(istream& istr, char *buffer, bool ignoreBraces = TRUE, bool ReadBib(char *filename) { + if (!wxFileExists(filename)) + return FALSE; + char buf[300]; -#if !wxUSE_IOSTREAMH && __WXMSW__ ifstream istr(filename, ios::in); -#else - ifstream istr(filename, ios::nocreate | ios::in); -#endif if (istr.bad()) return FALSE; BibLine = 1; @@ -1167,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)) @@ -1291,11 +1292,11 @@ char *RegisterSetting(char *settingName, char *settingValue, bool interactive) bool ReadCustomMacros(char *filename) { -#if !wxUSE_IOSTREAMH && __WXMSW__ + if (!wxFileExists(filename)) + return FALSE; + ifstream istr(filename, ios::in); -#else - ifstream istr(filename, ios::nocreate | ios::in); -#endif + if (istr.bad()) return FALSE; CustomMacroList.Clear(); @@ -1638,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; }