X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..4c268e6a10d820b9ea9851924e37014caa9fb5e8:/utils/tex2rtf/src/tex2rtf.cpp diff --git a/utils/tex2rtf/src/tex2rtf.cpp b/utils/tex2rtf/src/tex2rtf.cpp index 78cbc34186..0e237025dc 100644 --- a/utils/tex2rtf/src/tex2rtf.cpp +++ b/utils/tex2rtf/src/tex2rtf.cpp @@ -182,6 +182,8 @@ bool MyApp::OnInit() } } + TexPathList.Add(::wxGetCwd()); + #ifdef NO_GUI if (InputFile.empty() || OutputFile.empty()) { @@ -402,7 +404,7 @@ bool MyApp::OnInit() wxString path = TexPathList.FindValidPath(MacroFile); if (!path.empty()) - ReadCustomMacros((wxChar *)path.c_str()); + ReadCustomMacros(path); #if wxUSE_STATUSBAR wxString inStr(_T("In ")); @@ -444,15 +446,15 @@ bool MyApp::OnInit() wxString path = TexPathList.FindValidPath(MacroFile); if (!path.empty()) - ReadCustomMacros((wxChar*)path.c_str()); + ReadCustomMacros(path); - Go(); - if (runTwice) + bool rc = Go(); + if ( rc && runTwice ) { - Go(); + rc = Go(); } #ifdef NO_GUI - return true; + return rc; #else OnExit(); // Do cleanup since OnExit won't be called now return false; @@ -758,7 +760,7 @@ void MyFrame::OnLoadMacros(wxCommandEvent& WXUNUSED(event)) if (!s.empty() && wxFileExists(s)) { MacroFile = copystring(s); - ReadCustomMacros((wxChar *)s.c_str()); + ReadCustomMacros(s); ShowCustomMacros(); } #endif // wxUSE_FILEDLG @@ -955,7 +957,7 @@ bool Go(void) frame->SetTitle(buf); } - wxStartTimer(); + wxLongLong localTime = wxGetLocalTimeMillis(); #endif // Find extension-less filename @@ -1057,8 +1059,8 @@ bool Go(void) wxString buf; #ifndef NO_GUI - long tim = wxGetElapsedTime(); - buf.Printf(_T("Finished PASS #%d in %ld seconds.\n"), passNumber, (long)(tim/1000.0)); + wxLongLong elapsed = wxGetLocalTimeMillis() - localTime; + buf.Printf(_T("Finished PASS #%d in %ld seconds.\n"), passNumber, (long)(elapsed.GetLo()/1000.0)); OnInform((wxChar *)buf.c_str()); if (errorCount)