X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5c66e5b2b2c064c209ccd94448ac0e5f4ec2f3f4..8715875f72af75123d13bb69d6ec6b185f568ea9:/utils/tex2rtf/src/tex2rtf.cpp diff --git a/utils/tex2rtf/src/tex2rtf.cpp b/utils/tex2rtf/src/tex2rtf.cpp index 9079adc56a..75a889fb4f 100644 --- a/utils/tex2rtf/src/tex2rtf.cpp +++ b/utils/tex2rtf/src/tex2rtf.cpp @@ -10,10 +10,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -323,8 +319,6 @@ bool MyApp::OnInit() if (isInteractive) { - wxChar buf[100]; - // Create the main frame window frame = new MyFrame(NULL, wxID_ANY, _T("Tex2RTF"), wxDefaultPosition, wxSize(400, 300)); #if wxUSE_STATUSBAR @@ -337,8 +331,9 @@ bool MyApp::OnInit() if (!InputFile.empty()) { - wxSnprintf(buf, sizeof(buf), _T("Tex2RTF [%s]"), wxFileNameFromPath(InputFile)); - frame->SetTitle(buf); + wxString title; + title.Printf( _T("Tex2RTF [%s]"), wxFileNameFromPath(InputFile).c_str()); + frame->SetTitle(title); } // Make a menubar @@ -407,27 +402,33 @@ bool MyApp::OnInit() wxString path = TexPathList.FindValidPath(MacroFile); if (!path.empty()) - ReadCustomMacros((wxChar *)path.c_str()); + ReadCustomMacros(path); #if wxUSE_STATUSBAR - wxStrcpy(buf, _T("In ")); + wxString inStr(_T("In ")); switch (convertMode) { - case TEX_RTF: - wxStrcat(buf, (winHelp) ? _T("WinHelp RTF") : _T("linear RTF")); - break; - case TEX_HTML: - wxStrcat(buf, _T("HTML")); - break; - case TEX_XLP: - wxStrcat(buf, _T("XLP")); - break; - default: - wxStrcat(buf, _T("unknown")); - break; + case TEX_RTF: + if(winHelp) + inStr += _T("WinHelp RTF"); + else + inStr += _T("linear RTF"); + break; + + case TEX_HTML: + inStr += _T("HTML"); + break; + + case TEX_XLP: + inStr += _T("XLP"); + break; + + default: + inStr += _T("unknown"); + break; } - wxStrcat(buf, _T(" mode.")); - frame->SetStatusText(buf, 1); + inStr += _T(" mode."); + frame->SetStatusText(inStr, 1); #endif // wxUSE_STATUSBAR frame->Show(true); @@ -443,7 +444,7 @@ bool MyApp::OnInit() wxString path = TexPathList.FindValidPath(MacroFile); if (!path.empty()) - ReadCustomMacros((wxChar*)path.c_str()); + ReadCustomMacros(path); Go(); if (runTwice) @@ -757,7 +758,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 @@ -954,7 +955,7 @@ bool Go(void) frame->SetTitle(buf); } - wxStartTimer(); + wxLongLong localTime = wxGetLocalTimeMillis(); #endif // Find extension-less filename @@ -1056,8 +1057,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)