// Name: htmlutil.cpp
// Purpose: Converts Latex to HTML
// Author: Julian Smart
-// Modified by:
+// Modified by: Wlodzimiez ABX Skiba 2003/2004 Unicode support
+// Ron Lee
// Created: 7.9.93
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
FILE *Titlepage = NULL;
// FILE *FrameTitlepage = NULL;
int fileId = 0;
-bool subsectionStarted = FALSE;
+bool subsectionStarted = false;
// Which column of a row are we in? (Assumes no nested tables, of course)
int currentColumn = 0;
// Are we in verbatim mode? If so, format differently.
-static bool inVerbatim = FALSE;
+static bool inVerbatim = false;
// Need to know whether we're in a table or figure for benefit
// of listoffigures/listoftables
-static bool inFigure = FALSE;
-static bool inTable = FALSE;
+static bool inFigure = false;
+static bool inTable = false;
// This is defined in the Tex2Any library.
extern wxChar *BigBuffer;
wxChar buf[400];
if (truncateFilenames)
{
- wxSprintf(buf, _T("%s%d.htm"), FileRoot, fileId);
+ wxSnprintf(buf, sizeof(buf), _T("%s%d.htm"), FileRoot, fileId);
}
else
{
if (fileId == 1)
gs_filenames.Add(wxEmptyString);
- wxSprintf(buf, _T("%s_%s.html"), FileRoot, label);
+ wxSnprintf(buf, sizeof(buf), _T("%s_%s.html"), FileRoot, label);
gs_filenames.Add(buf);
}
if (*fileName) delete[] *fileName;
void ProcessText2HTML(TexChunk *chunk)
{
- bool changed = FALSE;
+ bool changed = false;
int ptr = 0;
int i = 0;
char ch = 1;
{
BigBuffer[ptr] = 0; wxStrcat(BigBuffer, _T("<P>\n\n")); ptr += 5;
i += 2;
- changed = TRUE;
+ changed = true;
}
else if (!inVerbatim && ch == '`' && (len >= i+1 && chunk->value[i+1] == '`'))
{
BigBuffer[ptr] = '"'; ptr ++;
i += 2;
- changed = TRUE;
+ changed = true;
}
else if (!inVerbatim && ch == '`') // Change ` to '
{
BigBuffer[ptr] = 39; ptr ++;
i += 1;
- changed = TRUE;
+ changed = true;
}
else if (ch == '<') // Change < to <
{
wxStrcat(BigBuffer, _T("<"));
ptr += 4;
i += 1;
- changed = TRUE;
+ changed = true;
}
else if (ch == '>') // Change > to >
{
wxStrcat(BigBuffer, _T(">"));
ptr += 4;
i += 1;
- changed = TRUE;
+ changed = true;
}
else
{
return;
if (def && (def->macroId == ltVERBATIM || def->macroId == ltVERB || def->macroId == ltSPECIAL))
- inVerbatim = TRUE;
+ inVerbatim = true;
wxNode *node = chunk->children.GetFirst();
while (node)
}
if (def && (def->macroId == ltVERBATIM || def->macroId == ltVERB || def->macroId == ltSPECIAL))
- inVerbatim = FALSE;
+ inVerbatim = false;
break;
}
{
// contentsReference = "<img align=center src=\"contents.gif\" BORDER=0 ALT=\"Contents\">";
contentsReference = contentsReferenceBuf;
- wxSprintf(contentsReference, _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Contents\">"), ConvertCase(_T("contents.gif")));
+ wxSnprintf(contentsReference, sizeof(contentsReferenceBuf),
+ _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Contents\">"),
+ ConvertCase(_T("contents.gif")));
}
wxChar *upReference; // no need to initialize because always assigned below
{
// upReference = "<img align=center src=\"up.gif\" ALT=\"Up\">";
upReference = upReferenceBuf;
- wxSprintf(upReference, _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Up\">"), ConvertCase(_T("up.gif")));
+ wxSnprintf(upReference, sizeof(upReferenceBuf),
+ _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Up\">"),
+ ConvertCase(_T("up.gif")));
}
wxChar *backReference; // no need to initialize because always assigned below
{
// backReference = "<img align=center src=\"back.gif\" ALT=\"Previous\">";
backReference = backReferenceBuf;
- wxSprintf(backReference, _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Previous\">"), ConvertCase(_T("back.gif")));
+ wxSnprintf(backReference, sizeof(backReferenceBuf),
+ _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Previous\">"),
+ ConvertCase(_T("back.gif")));
}
wxChar *forwardReference; // no need to initialize because always assigned below
{
// forwardReference = "<img align=center src=\"forward.gif\" ALT=\"Next\">";
forwardReference = forwardReferenceBuf;
- wxSprintf(forwardReference, _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Next\">"), ConvertCase(_T("forward.gif")));
+ wxSnprintf(forwardReference, sizeof(forwardReferenceBuf),
+ _T("<img align=center src=\"%s\" BORDER=0 ALT=\"Next\">"),
+ ConvertCase(_T("forward.gif")));
}
TexOutput(_T("<CENTER>"));
{
wxChar buf1[80];
wxStrcpy(buf1, ConvertCase(wxFileNameFromPath(FileRoot)));
- wxSprintf(buf, _T("\n<A HREF=\"%s.%s\">%s</A> "), buf1, ConvertCase(_T("htm")), contentsReference);
+ wxSnprintf(buf, sizeof(buf),
+ _T("\n<A HREF=\"%s.%s\">%s</A> "),
+ buf1, ConvertCase(_T("htm")), contentsReference);
}
else
{
wxChar buf1[80];
wxStrcpy(buf1, ConvertCase(wxFileNameFromPath(FileRoot)));
- wxSprintf(buf, _T("\n<A HREF=\"%s%s\">%s</A> "), buf1, ConvertCase(_T("_contents.html")), contentsReference);
+ wxSnprintf(buf, sizeof(buf),
+ _T("\n<A HREF=\"%s%s\">%s</A> "),
+ buf1, ConvertCase(_T("_contents.html")), contentsReference);
}
// TexOutput(_T("<NOFRAMES>"));
TexOutput(buf);
if (upLabel && upFilename)
{
if (wxStrlen(upLabel) > 0)
- wxSprintf(buf, _T("<A HREF=\"%s#%s\">%s</A> "), ConvertCase(upFilename), upLabel, upReference);
+ wxSnprintf(buf, sizeof(buf),
+ _T("<A HREF=\"%s#%s\">%s</A> "),
+ ConvertCase(upFilename), upLabel, upReference);
else
- wxSprintf(buf, _T("<A HREF=\"%s\">%s</A> "), ConvertCase(upFilename), upReference);
+ wxSnprintf(buf, sizeof(buf),
+ _T("<A HREF=\"%s\">%s</A> "),
+ ConvertCase(upFilename), upReference);
if (wxStrcmp(upLabel, _T("contents")) == 0)
{
// TexOutput(_T("<NOFRAMES>"));
if (previousLabel && previousFilename)
{
- wxSprintf(buf, _T("<A HREF=\"%s#%s\">%s</A> "), ConvertCase(previousFilename), previousLabel, backReference);
+ wxSnprintf(buf, sizeof(buf),
+ _T("<A HREF=\"%s#%s\">%s</A> "),
+ ConvertCase(previousFilename), previousLabel, backReference);
if (wxStrcmp(previousLabel, _T("contents")) == 0)
{
// TexOutput(_T("<NOFRAMES>"));
else
{
// A placeholder so the buttons don't keep moving position
- wxSprintf(buf, _T("%s "), backReference);
+ wxSnprintf(buf, sizeof(buf), _T("%s "), backReference);
TexOutput(buf);
}
if (nextLabel && nextFilename)
{
- wxSprintf(buf, _T("<A HREF=\"%s#%s\">%s</A> "), ConvertCase(nextFilename), nextLabel, forwardReference);
+ wxSnprintf(buf, sizeof(buf),
+ _T("<A HREF=\"%s#%s\">%s</A> "),
+ ConvertCase(nextFilename), nextLabel, forwardReference);
TexOutput(buf);
}
else
{
// A placeholder so the buttons don't keep moving position
- wxSprintf(buf, _T("%s "), forwardReference);
+ wxSnprintf(buf, sizeof(buf), _T("%s "), forwardReference);
TexOutput(buf);
}
wxString token1 = tok.GetNextToken();
if (!tok.HasMoreTokens())
{
- *isPicture = TRUE;
+ *isPicture = true;
return resStr;
}
else
{
wxString token2 = tok.GetNextToken();
- *isPicture = FALSE;
+ *isPicture = false;
if (tok.HasMoreTokens())
{
wxString token3 = tok.GetNextToken();
TexOutput(_T("\n<BODY"));
if (backgroundImageString)
{
- bool isPicture = FALSE;
+ bool isPicture = false;
wxChar *s = ParseColourString(backgroundImageString, &isPicture);
if (s)
{
}
if (backgroundColourString)
{
- bool isPicture = FALSE;
+ bool isPicture = false;
wxChar *s = ParseColourString(backgroundColourString, &isPicture);
if (s)
{
// Set foreground text colour, if one is specified
if (textColourString)
{
- bool isPicture = FALSE;
+ bool isPicture = false;
wxChar *s = ParseColourString(textColourString, &isPicture);
if (s)
{
// Set link text colour, if one is specified
if (linkColourString)
{
- bool isPicture = FALSE;
+ bool isPicture = false;
wxChar *s = ParseColourString(linkColourString, &isPicture);
if (s)
{
// Set followed link text colour, if one is specified
if (followedLinkColourString)
{
- bool isPicture = FALSE;
+ bool isPicture = false;
wxChar *s = ParseColourString(followedLinkColourString, &isPicture);
if (s)
{
chapterNo ++;
SetCurrentOutput(NULL);
- startedSections = TRUE;
+ startedSections = true;
wxChar *topicName = FindTopicName(GetNextChunk());
ReopenFile(&Chapters, &ChaptersName, topicName);
wxChar titleBuf[200];
if (truncateFilenames)
- wxSprintf(titleBuf, _T("%s.htm"), wxFileNameFromPath(FileRoot));
+ wxSnprintf(titleBuf, sizeof(titleBuf), _T("%s.htm"), wxFileNameFromPath(FileRoot));
else
- wxSprintf(titleBuf, _T("%s_contents.html"), wxFileNameFromPath(FileRoot));
+ wxSnprintf(titleBuf, sizeof(titleBuf), _T("%s_contents.html"), wxFileNameFromPath(FileRoot));
wxFprintf(Chapters, _T("<A NAME=\"%s\"></A>"), topicName);
{
subsectionNo = 0;
subsubsectionNo = 0;
- subsectionStarted = FALSE;
+ subsectionStarted = false;
if (macroId != ltSECTIONSTAR)
sectionNo ++;
SetCurrentOutput(NULL);
- startedSections = TRUE;
+ startedSections = true;
wxChar *topicName = FindTopicName(GetNextChunk());
ReopenFile(&Sections, &SectionsName, topicName);
ReopenSectionContentsFile();
}
- startedSections = TRUE;
- subsectionStarted = TRUE;
+ startedSections = true;
+ subsectionStarted = true;
wxChar *topicName = FindTopicName(GetNextChunk());
if (macroId != ltSUBSUBSECTIONSTAR)
subsubsectionNo ++;
- startedSections = TRUE;
+ startedSections = true;
wxChar *topicName = FindTopicName(GetNextChunk());
wxChar buf[100];
if (TableData[currentColumn].justification == 'c')
- wxSprintf(buf, _T("\n<TD ALIGN=CENTER>"));
+ wxSnprintf(buf, sizeof(buf), _T("\n<TD ALIGN=CENTER>"));
else if (TableData[currentColumn].justification == 'r')
- wxSprintf(buf, _T("\n<TD ALIGN=RIGHT>"));
+ wxSnprintf(buf, sizeof(buf), _T("\n<TD ALIGN=RIGHT>"));
else if (TableData[currentColumn].absWidth)
{
// Convert from points * 20 into pixels.
// Say the display is 100 DPI (dots/pixels per inch).
// There are 72 pts to the inch. So 1pt = 1/72 inch, or 100 * 1/72 dots.
int pixels = (int)(points * 100.0 / 72.0);
- wxSprintf(buf, _T("<TD ALIGN=CENTER WIDTH=%d>"), pixels);
+ wxSnprintf(buf, sizeof(buf), _T("<TD ALIGN=CENTER WIDTH=%d>"), pixels);
}
else
- wxSprintf(buf, _T("\n<TD ALIGN=LEFT>"));
+ wxSnprintf(buf, sizeof(buf), _T("\n<TD ALIGN=LEFT>"));
TexOutput(buf);
OutputFont();
}
// Start new row and cell, setting alignment for the first cell.
wxChar buf[100];
if (TableData[currentColumn].justification == 'c')
- wxSprintf(buf, _T("<TR>\n<TD ALIGN=CENTER>"));
+ wxSnprintf(buf, sizeof(buf), _T("<TR>\n<TD ALIGN=CENTER>"));
else if (TableData[currentColumn].justification == 'r')
- wxSprintf(buf, _T("<TR>\n<TD ALIGN=RIGHT>"));
+ wxSnprintf(buf, sizeof(buf), _T("<TR>\n<TD ALIGN=RIGHT>"));
else if (TableData[currentColumn].absWidth)
{
// Convert from points * 20 into pixels.
// Say the display is 100 DPI (dots/pixels per inch).
// There are 72 pts to the inch. So 1pt = 1/72 inch, or 100 * 1/72 dots.
int pixels = (int)(points * 100.0 / 72.0);
- wxSprintf(buf, _T("<TR>\n<TD ALIGN=CENTER WIDTH=%d>"), pixels);
+ wxSnprintf(buf, sizeof(buf), _T("<TR>\n<TD ALIGN=CENTER WIDTH=%d>"), pixels);
}
else
- wxSprintf(buf, _T("<TR>\n<TD ALIGN=LEFT>"));
+ wxSnprintf(buf, sizeof(buf), _T("<TR>\n<TD ALIGN=LEFT>"));
TexOutput(buf);
OutputFont();
}
{
if (start)
{
- if (inVerbatim)
+ #if (1) // if(inVerbatim)
TexOutput(_T("~"));
- else
+ #else
TexOutput(_T(" "));
+ #endif
}
break;
}
if (start)
{
wxChar buf[100];
- wxSprintf(buf, _T("<PRE>\n"));
+ wxSnprintf(buf, sizeof(buf), _T("<PRE>\n"));
TexOutput(buf);
}
else TexOutput(_T("</PRE>\n"));
case ltCOPYRIGHT:
{
if (start)
- TexOutput(_T("©"), TRUE);
+ TexOutput(_T("©"), true);
break;
}
case ltREGISTERED:
{
if (start)
- TexOutput(_T("®"), TRUE);
+ TexOutput(_T("®"), true);
break;
}
// Arrows
figureNo ++;
if (DocumentStyle != LATEX_ARTICLE)
- wxSprintf(figBuf, _T("%s %d.%d: "), FigureNameString, chapterNo, figureNo);
+ wxSnprintf(figBuf, sizeof(figBuf), _T("%s %d.%d: "), FigureNameString, chapterNo, figureNo);
else
- wxSprintf(figBuf, _T("%s %d: "), FigureNameString, figureNo);
+ wxSnprintf(figBuf, sizeof(figBuf), _T("%s %d: "), FigureNameString, figureNo);
}
else
{
tableNo ++;
if (DocumentStyle != LATEX_ARTICLE)
- wxSprintf(figBuf, _T("%s %d.%d: "), TableNameString, chapterNo, tableNo);
+ wxSnprintf(figBuf, sizeof(figBuf), _T("%s %d.%d: "), TableNameString, chapterNo, tableNo);
else
- wxSprintf(figBuf, _T("%s %d: "), TableNameString, tableNo);
+ wxSnprintf(figBuf, sizeof(figBuf), _T("%s %d: "), TableNameString, tableNo);
}
TexOutput(figBuf);
}
case ltFIGURE:
{
- if (start) inFigure = TRUE;
- else inFigure = FALSE;
+ if (start) inFigure = true;
+ else inFigure = false;
break;
}
case ltTABLE:
{
- if (start) inTable = TRUE;
- else inTable = FALSE;
+ if (start) inTable = true;
+ else inTable = false;
break;
}
default:
{
if (!start && (arg_no == 1))
currentSection = GetArgChunk();
- return FALSE;
+ return false;
}
case ltFUNC:
{
{
TexOutput(sec);
}
- return FALSE;
+ return false;
}
break;
}
case ltURLREF:
{
if (IsArgOptional())
- return FALSE;
+ return false;
else if ((GetNoArgs() - arg_no) == 1)
{
if (start)
helpRefText = GetArgChunk();
- return FALSE;
+ return false;
}
else if ((GetNoArgs() - arg_no) == 0) // Arg = 2, or 3 if first is optional
{
{
TexChunk *ref = GetArgChunk();
TexOutput(_T("<A HREF=\""));
- inVerbatim = TRUE;
+ inVerbatim = true;
TraverseChildrenFromChunk(ref);
- inVerbatim = FALSE;
+ inVerbatim = false;
TexOutput(_T("\">"));
if (helpRefText)
TraverseChildrenFromChunk(helpRefText);
TexOutput(_T("</A>"));
}
- return FALSE;
+ return false;
}
break;
}
{
if (start)
helpRefFilename = GetArgChunk();
- return FALSE;
+ return false;
}
if ((GetNoArgs() - arg_no) == 1)
{
if (start)
helpRefText = GetArgChunk();
- return FALSE;
+ return false;
}
else if ((GetNoArgs() - arg_no) == 0) // Arg = 2, or 3 if first is optional
{
}
else TexOutput(_T("??"));
}
- return FALSE;
+ return false;
}
break;
}
TexOutput(_T("<A HREF=\""));
TexOutput(ConvertCase(wxFileNameFromPath(filename)));
TexOutput(_T("\">Picture</A>\n"));
- wxSprintf(buf, _T("Warning: could not find an inline XBM/GIF for %s."), filename);
+ wxSnprintf(buf, sizeof(buf), _T("Warning: could not find an inline XBM/GIF for %s."), filename);
OnInform(buf);
}
}
}
- return FALSE;
+ return false;
}
// First arg is PSBOX spec (ignored), second is image file, third is map name.
case ltIMAGEMAP:
if (f == _T(""))
{
wxChar buf[300];
- wxSprintf(buf, _T("Warning: could not find an inline XBM/GIF for %s."), filename);
+ wxSnprintf(buf, sizeof(buf), _T("Warning: could not find an inline XBM/GIF for %s."), filename);
OnInform(buf);
}
delete[] filename;
imageFile = NULL;
}
}
- return FALSE;
+ return false;
}
case ltINDENTED :
{
if ( arg_no == 1 )
- return FALSE;
+ return false;
else
{
- return TRUE;
+ return true;
}
}
case ltITEM:
if (start)
{
descriptionItemArg = GetArgChunk();
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
case ltTWOCOLITEM:
case ltTWOCOLITEMRULED:
// DHS
if (TwoColWidthA > -1) {
wxChar buf[100];
- wxSprintf(buf,_T("\n<TR><TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthA);
+ wxSnprintf(buf, sizeof(buf), _T("\n<TR><TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthA);
TexOutput(buf);
} else
TexOutput(_T("\n<TR><TD VALIGN=TOP>\n"));
if ( start ) {
if (TwoColWidthB > -1) {
wxChar buf[100];
- wxSprintf(buf,_T("\n<TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthB);
+ wxSnprintf(buf, sizeof(buf), _T("\n<TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthB);
TexOutput(buf);
} else
TexOutput(_T("\n<TD VALIGN=TOP>\n"));
} else
TexOutput(_T("\n</FONT></TD></TR>\n"));
}
- return TRUE;
+ return true;
}
case ltNUMBEREDBIBITEM:
{
if (ref)
{
if (ref->sectionNumber) delete[] ref->sectionNumber;
- wxSprintf(buf, _T("[%d]"), citeCount);
+ wxSnprintf(buf, sizeof(buf), _T("[%d]"), citeCount);
ref->sectionNumber = copystring(buf);
}
- wxSprintf(buf, _T("\n<DT> [%d] "), citeCount);
+ wxSnprintf(buf, sizeof(buf), _T("\n<DT> [%d] "), citeCount);
TexOutput(buf);
citeCount ++;
- return FALSE;
+ return false;
}
if (arg_no == 2 && !start)
TexOutput(_T("<P>\n"));
- return TRUE;
+ return true;
}
case ltMARGINPAR:
case ltMARGINPARODD:
if (start)
{
TexOutput(_T("<HR>\n"));
- return TRUE;
+ return true;
}
else
TexOutput(_T("<HR><P>\n"));
float points = ParseUnitArgument(val);
TwoColWidthA = (int)((points * 100.0) / 72.0);
}
- return FALSE;
+ return false;
}
// DHS
case ltTWOCOLWIDTHB:
float points = ParseUnitArgument(val);
TwoColWidthB = (int)((points * 100.0) / 72.0);
}
- return FALSE;
+ return false;
}
/*
* Accents
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_ACUTE:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_CARET:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_TILDE:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_UMLAUT:
{
}
}
}
- return FALSE;
+ return false;
}
case ltACCENT_DOT:
{
}
}
}
- return FALSE;
+ return false;
}
case ltBACKGROUND:
{
wxChar *val = GetArgData();
if (val)
{
- bool isPicture = FALSE;
+ bool isPicture = false;
ParseColourString(val, &isPicture);
if (isPicture)
{
}
}
}
- return FALSE;
+ return false;
}
case ltBACKGROUNDIMAGE:
{
backgroundImageString = copystring(val);
}
}
- return FALSE;
+ return false;
}
case ltBACKGROUNDCOLOUR:
{
backgroundColourString = copystring(val);
}
}
- return FALSE;
+ return false;
}
case ltTEXTCOLOUR:
{
textColourString = copystring(val);
}
}
- return FALSE;
+ return false;
}
case ltLINKCOLOUR:
{
linkColourString = copystring(val);
}
}
- return FALSE;
+ return false;
}
case ltFOLLOWEDLINKCOLOUR:
{
followedLinkColourString = copystring(val);
}
}
- return FALSE;
+ return false;
}
case ltACCENT_CADILLA:
{
}
}
}
- return FALSE;
+ return false;
}
/*
case ltFOOTNOTE:
case ltFOOTNOTEPOPUP:
{
if (arg_no == 1)
- return TRUE;
+ return true;
else
- return FALSE;
+ return false;
break;
}
*/
if (start)
{
currentRowNumber = 0;
- inTabular = TRUE;
- startRows = TRUE;
- tableVerticalLineLeft = FALSE;
- tableVerticalLineRight = FALSE;
+ inTabular = true;
+ startRows = true;
+ tableVerticalLineLeft = false;
+ tableVerticalLineRight = false;
wxChar *alignString = copystring(GetArgData());
ParseTableArgument(alignString);
for (int i = 0; i < noColumns; i++)
{
currentWidth += TableData[i].width;
- wxSprintf(buf, _T("\\cellx%d"), currentWidth);
+ wxSnprintf(buf, sizeof(buf), _T("\\cellx%d"), currentWidth);
TexOutput(buf);
}
TexOutput(_T("\\pard\\intbl\n"));
}
delete[] alignString;
- return FALSE;
+ return false;
}
}
else if (arg_no == 2 && !start)
{
TexOutput(_T("</TABLE>\n"));
- inTabular = FALSE;
+ inTabular = false;
}
break;
}
wxChar titleBuf[150];
if (truncateFilenames)
- wxSprintf(titleBuf, _T("%s.htm"), wxFileNameFromPath(FileRoot));
+ wxSnprintf(titleBuf, sizeof(titleBuf), _T("%s.htm"), wxFileNameFromPath(FileRoot));
else
- wxSprintf(titleBuf, _T("%s_contents.html"), wxFileNameFromPath(FileRoot));
+ wxSnprintf(titleBuf, sizeof(titleBuf), _T("%s_contents.html"), wxFileNameFromPath(FileRoot));
HTMLHead();
TexOutput(_T("<title>"));
wxFprintf(Chapters, _T("</H2>\n</A>\n"));
SetCurrentOutput(Chapters);
- return FALSE;
+ return false;
}
if (!start && (arg_no == 2))
{
}
- return TRUE;
+ return true;
}
case ltINDEX:
{
AddKeyWordForTopic(CurrentTopic, buf, currentFileName);
}
}
- return FALSE;
+ return false;
}
case ltFCOL:
// case ltBCOL:
{
wxStrcpy(buf2, _T("#000000"));
wxChar buf[100];
- wxSprintf(buf, _T("Could not find colour name %s"), name);
+ wxSnprintf(buf, sizeof(buf), _T("Could not find colour name %s"), name);
OnError(buf);
}
TexOutput(_T("<FONT COLOR=\""));
}
case 2:
{
- return TRUE;
+ return true;
}
default:
break;
{
if (arg_no == 2) TexOutput(_T("</FONT>"));
}
- return FALSE;
+ return false;
}
case ltINSERTATLEVEL:
{
// This macro allows you to insert text at a different level
// from the current level, e.g. into the Sections from within a subsubsection.
if (useWord)
- return FALSE;
+ return false;
static int currentLevelNo = 1;
static FILE* oldLevelFile = Chapters;
if (start)
}
if (outputFile)
CurrentOutput1 = outputFile;
- return FALSE;
+ return false;
}
case 2:
{
- return TRUE;
+ return true;
}
default:
break;
}
- return TRUE;
+ return true;
}
else
{
{
CurrentOutput1 = oldLevelFile;
}
- return TRUE;
+ return true;
}
}
default:
return DefaultOnArgument(macroId, arg_no, start);
}
- return TRUE;
+ return true;
}
bool HTMLGo(void)
{
fileId = 0;
- inVerbatim = FALSE;
+ inVerbatim = false;
indentLevel = 0;
- inTabular = FALSE;
- startRows = FALSE;
- tableVerticalLineLeft = FALSE;
- tableVerticalLineRight = FALSE;
+ inTabular = false;
+ startRows = false;
+ tableVerticalLineLeft = false;
+ tableVerticalLineRight = false;
noColumns = 0;
if (InputFile && OutputFile)
wxChar buf[300];
if (truncateFilenames)
- wxSprintf(buf, _T("%s.htm"), FileRoot);
+ wxSnprintf(buf, sizeof(buf), _T("%s.htm"), FileRoot);
else
- wxSprintf(buf, _T("%s_contents.html"), FileRoot);
+ wxSnprintf(buf, sizeof(buf), _T("%s_contents.html"), FileRoot);
if (TitlepageName) delete[] TitlepageName;
TitlepageName = copystring(buf);
Titlepage = wxFopen(buf, _T("w"));
if (truncateFilenames)
- wxSprintf(buf, _T("%s_fc.htm"), FileRoot);
+ wxSnprintf(buf, sizeof(buf), _T("%s_fc.htm"), FileRoot);
else
- wxSprintf(buf, _T("%s_fcontents.html"), FileRoot);
+ wxSnprintf(buf, sizeof(buf), _T("%s_fcontents.html"), FileRoot);
contentsFrameName = copystring(buf);
if (!Titlepage || !Contents)
{
OnError(_T("Cannot open output file!"));
- return FALSE;
+ return false;
}
AddTexRef(_T("contents"), wxFileNameFromPath(TitlepageName), ContentsNameString);
{
wxChar firstFileName[300];
if (truncateFilenames)
- wxSprintf(firstFileName, _T("%s1.htm"), FileRoot);
+ wxSnprintf(firstFileName, sizeof(firstFileName), _T("%s1.htm"), FileRoot);
else
wxStrcpy(firstFileName, gs_filenames[1].c_str());
if (htmlIndex)
{
wxChar htmlIndexName[300];
- wxSprintf(htmlIndexName, _T("%s.htx"), FileRoot);
+ wxSnprintf(htmlIndexName, sizeof(htmlIndexName), _T("%s.htx"), FileRoot);
GenerateHTMLIndexFile(htmlIndexName);
}
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
// Output .htx index file
return;
TopicTable.BeginFind();
- wxNode *node = TopicTable.Next();
+ wxHashTable::Node *node = TopicTable.Next();
while (node)
{
TexTopic *texTopic = (TexTopic *)node->GetData();
/* Generate project file : */
- wxSprintf(buf, _T("%s.hhp"), fname);
+ wxSnprintf(buf, sizeof(buf), _T("%s.hhp"), fname);
f = wxFopen(buf, _T("wt"));
wxFprintf(f,
_T("[OPTIONS]\n")
wxFprintf(f, _T("%s\n"), wxFileNameFromPath(TitlepageName));
for (int i = 1; i <= fileId; i++) {
if (truncateFilenames)
- wxSprintf(buf, _T("%s%d.htm"), wxFileNameFromPath(FileRoot), i);
+ wxSnprintf(buf, sizeof(buf), _T("%s%d.htm"), wxFileNameFromPath(FileRoot), i);
else
wxStrcpy(buf, wxFileNameFromPath(gs_filenames[i].c_str()));
wxFprintf(f, _T("%s\n"), buf);
/* Generate index file : */
- wxSprintf(buf, _T("%s.hhk"), fname);
+ wxSnprintf(buf, sizeof(buf), _T("%s.hhk"), fname);
f = wxFopen(buf, _T("wt"));
wxFprintf(f,
_T("<UL>\n"));
TopicTable.BeginFind();
- wxNode *node = TopicTable.Next();
+ wxHashTable::Node *node = TopicTable.Next();
while (node)
{
TexTopic *texTopic = (TexTopic *)node->GetData();
void HTMLWorkshopStartContents()
{
wxChar buf[300];
- wxSprintf(buf, _T("%s.hhc"), FileRoot);
+ wxSnprintf(buf, sizeof(buf), _T("%s.hhc"), FileRoot);
HTMLWorkshopContents = wxFopen(buf, _T("wt"));
HTMLWorkshopLastLevel = 0;