git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14732
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// Add this section title to the list of keywords
if (htmlIndex)
{
// Add this section title to the list of keywords
if (htmlIndex)
{
- OutputCurrentSectionToString(wxBuffer);
- AddKeyWordForTopic(topicName, wxBuffer, ConvertCase(currentFileName));
+ OutputCurrentSectionToString(wxTex2RTFBuffer);
+ AddKeyWordForTopic(topicName, wxTex2RTFBuffer, ConvertCase(currentFileName));
// Add this section title to the list of keywords
if (htmlIndex)
{
// Add this section title to the list of keywords
if (htmlIndex)
{
- OutputCurrentSectionToString(wxBuffer);
- AddKeyWordForTopic(topicName, wxBuffer, currentFileName);
+ OutputCurrentSectionToString(wxTex2RTFBuffer);
+ AddKeyWordForTopic(topicName, wxTex2RTFBuffer, currentFileName);
// Add this section title to the list of keywords
if (htmlIndex)
{
// Add this section title to the list of keywords
if (htmlIndex)
{
- OutputCurrentSectionToString(wxBuffer);
- AddKeyWordForTopic(topicName, wxBuffer, currentFileName);
+ OutputCurrentSectionToString(wxTex2RTFBuffer);
+ AddKeyWordForTopic(topicName, wxTex2RTFBuffer, currentFileName);
// Add this section title to the list of keywords
if (htmlIndex)
{
// Add this section title to the list of keywords
if (htmlIndex)
{
- OutputCurrentSectionToString(wxBuffer);
- AddKeyWordForTopic(topicName, wxBuffer, currentFileName);
+ OutputCurrentSectionToString(wxTex2RTFBuffer);
+ AddKeyWordForTopic(topicName, wxTex2RTFBuffer, currentFileName);
// : for space.
void OutputSectionKeyword(FILE *fd)
{
// : for space.
void OutputSectionKeyword(FILE *fd)
{
- OutputCurrentSectionToString(wxBuffer);
+ OutputCurrentSectionToString(wxTex2RTFBuffer);
- for (i = 0; i < strlen(wxBuffer); i++)
- if (wxBuffer[i] == ':')
- wxBuffer[i] = ' ';
+ for (i = 0; i < strlen(wxTex2RTFBuffer); i++)
+ if (wxTex2RTFBuffer[i] == ':')
+ wxTex2RTFBuffer[i] = ' ';
// Don't write to index if there's some RTF in the string
// Don't write to index if there's some RTF in the string
- else if ( wxBuffer[i] == '{' )
+ else if ( wxTex2RTFBuffer[i] == '{' )
return;
fprintf(fd, "K{\\footnote {K} ");
return;
fprintf(fd, "K{\\footnote {K} ");
- fprintf(fd, "%s", wxBuffer);
+ fprintf(fd, "%s", wxTex2RTFBuffer);
if (winHelpContents && winHelp && !InPopups())
{
if (winHelpContents && winHelp && !InPopups())
{
- OutputCurrentSectionToString(wxBuffer);
- WriteWinHelpContentsFileLine(topicName, wxBuffer, 1);
+ OutputCurrentSectionToString(wxTex2RTFBuffer);
+ WriteWinHelpContentsFileLine(topicName, wxTex2RTFBuffer, 1);
}
AddTexRef(topicName, NULL, ChapterNameString, chapterNo);
}
AddTexRef(topicName, NULL, ChapterNameString, chapterNo);
NotifyParentHasChildren(1);
if (winHelpContents && winHelp && !InPopups())
{
NotifyParentHasChildren(1);
if (winHelpContents && winHelp && !InPopups())
{
- OutputCurrentSectionToString(wxBuffer);
- WriteWinHelpContentsFileLine(topicName, wxBuffer, 2);
+ OutputCurrentSectionToString(wxTex2RTFBuffer);
+ WriteWinHelpContentsFileLine(topicName, wxTex2RTFBuffer, 2);
}
AddTexRef(topicName, NULL, SectionNameString, chapterNo, sectionNo);
}
AddTexRef(topicName, NULL, SectionNameString, chapterNo, sectionNo);
NotifyParentHasChildren(2);
if (winHelpContents && winHelp && !InPopups())
{
NotifyParentHasChildren(2);
if (winHelpContents && winHelp && !InPopups())
{
- OutputCurrentSectionToString(wxBuffer);
- WriteWinHelpContentsFileLine(topicName, wxBuffer, 3);
+ OutputCurrentSectionToString(wxTex2RTFBuffer);
+ WriteWinHelpContentsFileLine(topicName, wxTex2RTFBuffer, 3);
}
AddTexRef(topicName, NULL, SectionNameString, chapterNo, sectionNo, subsectionNo);
}
AddTexRef(topicName, NULL, SectionNameString, chapterNo, sectionNo, subsectionNo);
NotifyParentHasChildren(3);
if (winHelpContents && winHelp)
{
NotifyParentHasChildren(3);
if (winHelpContents && winHelp)
{
- OutputCurrentSectionToString(wxBuffer);
- WriteWinHelpContentsFileLine(topicName, wxBuffer, 4);
+ OutputCurrentSectionToString(wxTex2RTFBuffer);
+ WriteWinHelpContentsFileLine(topicName, wxTex2RTFBuffer, 4);
}
AddTexRef(topicName, NULL, SectionNameString, chapterNo, sectionNo, subsectionNo, subsubsectionNo);
}
AddTexRef(topicName, NULL, SectionNameString, chapterNo, sectionNo, subsectionNo, subsubsectionNo);
pos ++;
int noBraces = 1;
pos ++;
int noBraces = 1;
+ wxTex2RTFBuffer[0] = 0;
int i = 0;
bool end = FALSE;
while (!end)
int i = 0;
bool end = FALSE;
while (!end)
noBraces --;
if (noBraces == 0)
{
noBraces --;
if (noBraces == 0)
{
+ wxTex2RTFBuffer[i] = 0;
+ wxTex2RTFBuffer[i] = '}';
i ++;
}
pos ++;
}
else if (ch == '{')
{
i ++;
}
pos ++;
}
else if (ch == '{')
{
+ wxTex2RTFBuffer[i] = '{';
i ++;
pos ++;
}
else if (ch == '\\' && buffer[pos+1] == '}')
{
i ++;
pos ++;
}
else if (ch == '\\' && buffer[pos+1] == '}')
{
+ wxTex2RTFBuffer[i] = '}';
pos += 2;
i++;
}
else if (ch == '\\' && buffer[pos+1] == '{')
{
pos += 2;
i++;
}
else if (ch == '\\' && buffer[pos+1] == '{')
{
+ wxTex2RTFBuffer[i] = '{';
+ wxTex2RTFBuffer[i] = ch;
pos ++;
i ++;
if (ch == 0)
pos ++;
i ++;
if (ch == 0)
TexChunk *argValue = new TexChunk(CHUNK_TYPE_STRING);
arg->children.Append((wxObject *)argValue);
argValue->argn = 1;
TexChunk *argValue = new TexChunk(CHUNK_TYPE_STRING);
arg->children.Append((wxObject *)argValue);
argValue->argn = 1;
- argValue->value = copystring(wxBuffer);
+ argValue->value = copystring(wxTex2RTFBuffer);
children.Append((wxObject *)chunk);
}
children.Append((wxObject *)chunk);
}
void AddKeyWordForTopic(char *topic, char *entry, char *filename = NULL);
void ClearKeyWordTable(void);
void AddKeyWordForTopic(char *topic, char *entry, char *filename = NULL);
void ClearKeyWordTable(void);
+extern char wxTex2RTFBuffer[];
extern TexChunk *TopLevel;
extern wxHashTable MacroDefs;
extern wxStringList IgnorableInputFiles; // Ignorable \input files, e.g. psbox.tex
extern TexChunk *TopLevel;
extern wxHashTable MacroDefs;
extern wxStringList IgnorableInputFiles; // Ignorable \input files, e.g. psbox.tex
bool Go(void);
void ShowOptions(void);
bool Go(void);
void ShowOptions(void);
+char wxTex2RTFBuffer[1500];
-#if wxUSE_GUI || !defined(__UNIX__)
-// wxBase for Unix does not have wxBuffer
-extern
-#endif
-char *wxBuffer; // we must init it, otherwise tex2rtf will crash
int main(int argc, char **argv)
#else
int main(int argc, char **argv)
#else
- wxBuffer = new char[1500];
- // this is done in wxApp, but NO_GUI version doesn't call it :-(
-
if (!InputFile || !OutputFile)
{
wxSTD cout << "Tex2RTF: input or output file is missing.\n";
if (!InputFile || !OutputFile)
{
wxSTD cout << "Tex2RTF: input or output file is missing.\n";
// Return the main frame window
return TRUE;
#else
// Return the main frame window
return TRUE;
#else