#else
#include <iostream>
#include <fstream>
+using namespace std;
#endif
#include <ctype.h>
if (!wxFileExists(filename))
return;
- wxSTD ifstream istr(filename, ios::in);
+ wxSTD ifstream istr(filename, wxSTD ios::in);
if (istr.bad()) return;
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);
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;
else if (StringMatch(settingName, "authorFontSize", FALSE, TRUE))
StringToInt(settingValue, &authorFont);
else if (StringMatch(settingName, "ignoreInput", FALSE, TRUE))
- IgnorableInputFiles.Add(FileNameFromPath(settingValue));
+ IgnorableInputFiles.Add(wxFileNameFromPath(settingValue));
else if (StringMatch(settingName, "mirrorMargins", FALSE, TRUE))
mirrorMargins = StringTobool(settingValue);
else if (StringMatch(settingName, "runTwice", FALSE, TRUE))
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))
if (!wxFileExists(filename))
return FALSE;
- wxSTD ifstream istr(filename, ios::in);
+ wxSTD ifstream istr(filename, wxSTD ios::in);
if (istr.bad()) return FALSE;
* 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
}
buf[i] = 0;
return buf;
}
+
+#if !WXWIN_COMPATIBILITY_2
+// if substring is TRUE, search for str1 in str2
+bool StringMatch(const wxChar *str1, const wxChar *str2, bool subString,
+ bool exact)
+{
+ if (subString)
+ {
+ wxString Sstr1(str1);
+ wxString Sstr2(str2);
+ if (!exact)
+ {
+ Sstr1.MakeUpper();
+ Sstr2.MakeUpper();
+ }
+ return Sstr2.Index(Sstr1) != wxNOT_FOUND;
+ }
+ else
+ return exact ? wxString(str2).Cmp(str1) == 0 :
+ wxString(str2).CmpNoCase(str1) == 0;
+}
+#endif