#include "wx/textctrl.h"
#include "wx/filedlg.h"
#include "wx/msgdlg.h"
+ #include "wx/icon.h"
#endif
#endif
{ return wxStrcpy(new wxChar[wxStrlen(s) + 1], s); }
#endif
-const float versionNo = (float)TEX2RTF_VERSION_NUMBER;
+const float versionNo = float(TEX2RTF_VERSION_NUMBER);
TexChunk *currentMember = NULL;
bool startedSections = false;
}
}
}
+ else if (wxStrcmp(argv[i], _T("-checkcurlybraces")) == 0)
+ {
+ i ++;
+ checkCurlyBraces = true;
+ }
else if (wxStrcmp(argv[i], _T("-checkcurleybraces")) == 0)
{
+ // Support the old, incorrectly spelled version of -checkcurlybraces
+ // so that old scripts which run tex2rtf -checkcurleybraces still work.
i ++;
- checkCurleyBraces = true;
+ checkCurlyBraces = true;
}
else if (wxStrcmp(argv[i], _T("-checksyntax")) == 0)
{
wxMenu *options_menu = new wxMenu;
- options_menu->Append(TEX_OPTIONS_CURLEY_BRACE, _T("Curley brace matching"), _T("Checks for mismatched curley braces"),true);
+ options_menu->Append(TEX_OPTIONS_CURLY_BRACE, _T("Curly brace matching"), _T("Checks for mismatched curly braces"),true);
options_menu->Append(TEX_OPTIONS_SYNTAX_CHECKING, _T("Syntax checking"), _T("Syntax checking for common errors"),true);
- options_menu->Check(TEX_OPTIONS_CURLEY_BRACE, checkCurleyBraces);
+ options_menu->Check(TEX_OPTIONS_CURLY_BRACE, checkCurlyBraces);
options_menu->Check(TEX_OPTIONS_SYNTAX_CHECKING, checkSyntax);
wxMenu *help_menu = new wxMenu;
*/
wxString path = TexPathList.FindValidPath(MacroFile);
- if (path != _T(""))
+ if (!path.empty())
ReadCustomMacros((wxChar *)path.c_str());
#if wxUSE_STATUSBAR
*/
wxString path = TexPathList.FindValidPath(MacroFile);
- if (path != _T(""))
+ if (!path.empty())
ReadCustomMacros((wxChar*)path.c_str());
Go();
OnInform(_T(" -charset <pc | pca | ansi | mac> (default ansi)"));
OnInform(_T(" -twice"));
OnInform(_T(" -sync"));
- OnInform(_T(" -checkcurleybraces"));
+ OnInform(_T(" -checkcurlybraces"));
OnInform(_T(" -checksyntax"));
OnInform(_T(" -macros <filename>"));
OnInform(_T(" -winhelp"));
EVT_MENU(TEX_MODE_WINHELP, MyFrame::OnModeWinHelp)
EVT_MENU(TEX_MODE_HTML, MyFrame::OnModeHTML)
EVT_MENU(TEX_MODE_XLP, MyFrame::OnModeXLP)
- EVT_MENU(TEX_OPTIONS_CURLEY_BRACE, MyFrame::OnOptionsCurleyBrace)
+ EVT_MENU(TEX_OPTIONS_CURLY_BRACE, MyFrame::OnOptionsCurlyBrace)
EVT_MENU(TEX_OPTIONS_SYNTAX_CHECKING, MyFrame::OnOptionsSyntaxChecking)
EVT_MENU(TEX_HELP, MyFrame::OnHelp)
EVT_MENU(TEX_ABOUT, MyFrame::OnAbout)
{
textWindow->Clear();
wxString s = wxFileSelector(_T("Choose custom macro file"), wxPathOnly(MacroFile), wxFileNameFromPath(MacroFile), _T("ini"), _T("*.ini"));
- if (s != _T("") && wxFileExists(s))
+ if (!s.empty() && wxFileExists(s))
{
MacroFile = copystring(s);
ReadCustomMacros((wxChar *)s.c_str());
#endif // wxUSE_STATUSBAR
}
-void MyFrame::OnOptionsCurleyBrace(wxCommandEvent& WXUNUSED(event))
+void MyFrame::OnOptionsCurlyBrace(wxCommandEvent& WXUNUSED(event))
{
- checkCurleyBraces = !checkCurleyBraces;
+ checkCurlyBraces = !checkCurlyBraces;
#if wxUSE_STATUSBAR
- if (checkCurleyBraces)
+ if (checkCurlyBraces)
{
- SetStatusText(_T("Checking curley braces: YES"), 1);
+ SetStatusText(_T("Checking curly braces: YES"), 1);
}
else
{
- SetStatusText(_T("Checking curley braces: NO"), 1);
+ SetStatusText(_T("Checking curly braces: NO"), 1);
}
#endif // wxUSE_STATUSBAR
}
if (force || !InputFile)
{
wxString s = wxFileSelector(_T("Choose LaTeX input file"), wxPathOnly(InputFile), wxFileNameFromPath(InputFile), _T("tex"), _T("*.tex"));
- if (s != _T(""))
+ if (!s.empty())
{
// Different file, so clear index entries.
ClearKeyWordTable();
{
wxString s = wxFileSelector(_T("Choose output file"), path, wxFileNameFromPath(OutputFile),
extensionBuf, wildBuf);
- if (s != _T(""))
+ if (!s.empty())
OutputFile = copystring(s);
}
}
if (!bulletFile)
{
wxString s = TexPathList.FindValidPath(_T("bullet.bmp"));
- if (s != _T(""))
+ if (!s.empty())
{
wxString str = wxFileNameFromPath(s);
bulletFile = copystring(str);