fixed spelling of -checkcurleybraces (patch #1054304)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30198 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2004-10-31 08:31:03 +00:00
parent fd5e476dbb
commit 88fd7006f4
6 changed files with 51 additions and 43 deletions

View File

@ -93,7 +93,7 @@ DO:
\end{verbatim} block
- check that your changes/additions to any TEX documentation
compiles before checking it in! Use the '-checkcurleybraces'
compiles before checking it in! Use the '-checkcurlybraces'
and '-checksyntax' commandline parameters (or the OPTIONS menu
if running in GUI mode) to check for some of the more common
mistakes. See TROUBLESHOOTING below for more details
@ -154,7 +154,7 @@ here is one important tip:
caused the problem.
When making changes/additions to the documentation, always use
the '-checkcurleybraces' and '-checksyntax' commandline parameters
the '-checkcurlybraces' and '-checksyntax' commandline parameters
(or turn these options on in the GUI version via the OPTIONS menu
choice), BEFORE checking in your changes. These two debugging
options will catch many of the more common mistakes that are made

View File

@ -240,6 +240,7 @@ void WriteWinHelpContentsFileLine(wxChar *topicName, wxChar *xitle, int level)
wxChar title[255];
int s=0;
int d=0;
// assuming iso-8859-1 here even in Unicode build (FIXME?)
while ( (xitle[s]!=0)&&(d<255) )
{
wxChar ch=wxChar(xitle[s]&0xff);
@ -248,12 +249,12 @@ void WriteWinHelpContentsFileLine(wxChar *topicName, wxChar *xitle, int level)
wxChar ch2=wxChar(xitle[s+2]&0xff);
wxChar ch3=wxChar(xitle[s+3]&0xff);
s+=4; // next character
if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]=_T('ö'); }
if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]=_T('ä'); }
if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]=_T('ü'); }
if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x36)) { title[d++]=_T('Ö'); }
if ((ch1==0x27)&&(ch2==0x63)&&(ch3==0x34)) { title[d++]=_T('Ä'); }
if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x63)) { title[d++]=_T('Ü'); }
if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]=wxChar('ö'); }
if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]=wxChar('ä'); }
if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]=wxChar('ü'); }
if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x36)) { title[d++]=wxChar('Ö'); }
if ((ch1==0x27)&&(ch2==0x63)&&(ch3==0x34)) { title[d++]=wxChar('Ä'); }
if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x63)) { title[d++]=wxChar('Ü'); }
} else {
title[d++]=ch;
s++;
@ -670,7 +671,7 @@ void ProcessText2RTF(TexChunk *chunk)
i += 1;
changed = true;
}
else if (inVerbatim && (ch == '{' || ch == '}')) // Escape the curley bracket
else if (inVerbatim && (ch == '{' || ch == '}')) // Escape the curly bracket
{
BigBuffer[ptr] = '\\'; ptr ++;
BigBuffer[ptr] = ch; ptr ++;

View File

@ -113,7 +113,7 @@ bool winHelp = false; // Output in Windows Help format if true, line
bool isInteractive = false;
bool runTwice = false;
int convertMode = TEX_RTF;
bool checkCurleyBraces = false;
bool checkCurlyBraces = false;
bool checkSyntax = false;
bool headerRule = false;
bool footerRule = false;
@ -428,8 +428,8 @@ bool readInVerbatim = false; // Within a verbatim, but not nec. verbatiminput
// detection of \verb yet.
// #define CHECK_BRACES 1
unsigned long leftCurley = 0;
unsigned long rightCurley = 0;
unsigned long leftCurly = 0;
unsigned long rightCurly = 0;
static wxString currentFileName = _T("");
bool read_a_line(wxChar *buf)
@ -463,22 +463,22 @@ bool read_a_line(wxChar *buf)
lastChar = ch;
ch = getc(Inputs[CurrentInputIndex]);
if (checkCurleyBraces)
if (checkCurlyBraces)
{
if (ch == '{' && !readInVerbatim && lastChar != _T('\\'))
leftCurley++;
leftCurly++;
if (ch == '}' && !readInVerbatim && lastChar != _T('\\'))
{
rightCurley++;
if (rightCurley > leftCurley)
rightCurly++;
if (rightCurly > leftCurly)
{
wxString errBuf;
errBuf.Printf(_T("An extra right Curley brace ('}') was detected at line %lu inside file %s"), LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str());
errBuf.Printf(_T("An extra right Curly brace ('}') was detected at line %lu inside file %s"), LineNumbers[CurrentInputIndex], (const wxChar*) currentFileName.c_str());
OnError((wxChar *)errBuf.c_str());
// Reduce the count of right Curley braces, so the mismatched count
// Reduce the count of right Curly braces, so the mismatched count
// isn't reported on every line that has a '}' after the first mismatch
rightCurley--;
rightCurly--;
}
}
}
@ -639,17 +639,17 @@ bool read_a_line(wxChar *buf)
ch = ' '; // No real end of file
CurrentInputIndex --;
if (checkCurleyBraces)
if (checkCurlyBraces)
{
if (leftCurley != rightCurley)
if (leftCurly != rightCurly)
{
wxString errBuf;
errBuf.Printf(_T("Curley braces do not match inside file %s\n%lu opens, %lu closes"),
(const wxChar*) currentFileName.c_str(),leftCurley,rightCurley);
errBuf.Printf(_T("Curly braces do not match inside file %s\n%lu opens, %lu closes"),
(const wxChar*) currentFileName.c_str(),leftCurly,rightCurly);
OnError((wxChar *)errBuf.c_str());
}
leftCurley = 0;
rightCurley = 0;
leftCurly = 0;
rightCurly = 0;
}
if (readingVerbatim)
@ -849,13 +849,13 @@ bool read_a_line(wxChar *buf)
wxStrncmp(buf, _T("\\end{toocomplex}"), 16) == 0)
readInVerbatim = false;
if (checkCurleyBraces)
if (checkCurlyBraces)
{
if (ch == EOF && leftCurley != rightCurley)
if (ch == EOF && leftCurly != rightCurly)
{
wxString errBuf;
errBuf.Printf(_T("Curley braces do not match inside file %s\n%lu opens, %lu closes"),
(const wxChar*) currentFileName.c_str(),leftCurley,rightCurley);
errBuf.Printf(_T("Curly braces do not match inside file %s\n%lu opens, %lu closes"),
(const wxChar*) currentFileName.c_str(),leftCurly,rightCurly);
OnError((wxChar *)errBuf.c_str());
}
}

View File

@ -221,7 +221,7 @@ extern bool winHelp; // Output in Windows Help format if true, linear otherwise
extern bool isInteractive;
extern bool runTwice;
extern int convertMode;
extern bool checkCurleyBraces;
extern bool checkCurlyBraces;
extern bool checkSyntax;
extern bool stopRunning;
extern int mirrorMargins;

View File

@ -269,10 +269,17 @@ bool MyApp::OnInit()
}
}
}
else if (wxStrcmp(argv[i], _T("-checkcurleybraces")) == 0)
else if (wxStrcmp(argv[i], _T("-checkcurlybraces")) == 0)
{
i ++;
checkCurleyBraces = true;
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 ++;
checkCurlyBraces = true;
}
else if (wxStrcmp(argv[i], _T("-checksyntax")) == 0)
{
@ -351,10 +358,10 @@ bool MyApp::OnInit()
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;
@ -590,7 +597,7 @@ void ShowOptions(void)
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"));
@ -616,7 +623,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
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)
@ -793,17 +800,17 @@ void MyFrame::OnModeXLP(wxCommandEvent& WXUNUSED(event))
#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
}

View File

@ -60,7 +60,7 @@ class MyFrame: public wxFrame
void OnModeWinHelp(wxCommandEvent& event);
void OnModeHTML(wxCommandEvent& event);
void OnModeXLP(wxCommandEvent& event);
void OnOptionsCurleyBrace(wxCommandEvent& event);
void OnOptionsCurlyBrace(wxCommandEvent& event);
void OnOptionsSyntaxChecking(wxCommandEvent& event);
void OnHelp(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
@ -131,7 +131,7 @@ class ItemizeStruc: public wxObject
#define TEX_MODE_HTML 11
#define TEX_MODE_XLP 12
#define TEX_OPTIONS_CURLEY_BRACE 13
#define TEX_OPTIONS_CURLY_BRACE 13
#define TEX_OPTIONS_SYNTAX_CHECKING 14
#define TEX_HELP 15