Tex2RTF: underscores now only checked for if syntax checking is on.

Removed the MDIS_ALLCHILDSTYLES style again.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10543 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2001-06-11 21:52:58 +00:00
parent 33611ebbd9
commit fd85b0640e
7 changed files with 115 additions and 151 deletions

View File

@@ -581,31 +581,34 @@ bool read_a_line(char *buf)
break;
}
if (readInVerbatim)
if (checkSyntax)
{
// There should NOT be a '\' before the '_'
if ((bufIndex > 0 && (buf[bufIndex-1] == '\\')) && (buf[0] != '%'))
if (readInVerbatim)
{
wxString errBuf;
errBuf.Printf("An underscore ('_') was detected at line %lu inside file %s that should NOT have a '\\' before it.",LineNumbers[CurrentInputIndex], (const char*) currentFileName.c_str());
OnError((char *)errBuf.c_str());
// There should NOT be a '\' before the '_'
if ((bufIndex > 0 && (buf[bufIndex-1] == '\\')) && (buf[0] != '%'))
{
wxString errBuf;
errBuf.Printf("An underscore ('_') was detected at line %lu inside file %s that should NOT have a '\\' before it.",LineNumbers[CurrentInputIndex], (const char*) currentFileName.c_str());
OnError((char *)errBuf.c_str());
}
}
}
else
{
// There should be a '\' before the '_'
if (bufIndex == 0)
else
{
wxString errBuf;
errBuf.Printf("An underscore ('_') was detected at line %lu inside file %s that may need a '\\' before it.",LineNumbers[CurrentInputIndex], (const char*) currentFileName.c_str());
OnError((char *)errBuf.c_str());
}
else if ((buf[bufIndex-1] != '\\') && (buf[0] != '%') && // If it is a comment line, then no warnings
(strncmp(buf, "\\input", 6))) // do not report filenames that have underscores in them
{
wxString errBuf;
errBuf.Printf("An underscore ('_') was detected at line %lu inside file %s that may need a '\\' before it.",LineNumbers[CurrentInputIndex], (const char*) currentFileName.c_str());
OnError((char *)errBuf.c_str());
// There should be a '\' before the '_'
if (bufIndex == 0)
{
wxString errBuf;
errBuf.Printf("An underscore ('_') was detected at line %lu inside file %s that may need a '\\' before it.",LineNumbers[CurrentInputIndex], (const char*) currentFileName.c_str());
OnError((char *)errBuf.c_str());
}
else if ((buf[bufIndex-1] != '\\') && (buf[0] != '%') && // If it is a comment line, then no warnings
(strncmp(buf, "\\input", 6))) // do not report filenames that have underscores in them
{
wxString errBuf;
errBuf.Printf("An underscore ('_') was detected at line %lu inside file %s that may need a '\\' before it.",LineNumbers[CurrentInputIndex], (const char*) currentFileName.c_str());
OnError((char *)errBuf.c_str());
}
}
}
buf[bufIndex++] = ch;