merged 2.4 branch into the trunk

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-12-04 14:11:26 +00:00
parent 59a944cb63
commit 2b5f62a0b2
1057 changed files with 37805 additions and 24034 deletions

View File

@@ -108,7 +108,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmsw233d.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /out:"DebugDLL/tex2rtf.exe" /pdbtype:sept /libpath:"../../../lib" /libpath:"../../../contrib/lib"
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmsw234d.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /out:"DebugDLL/tex2rtf.exe" /pdbtype:sept /libpath:"../../../lib" /libpath:"../../../contrib/lib"
!ELSEIF "$(CFG)" == "Tex2RTFVC - Win32 Release DLL"

View File

@@ -191,7 +191,7 @@ void ReopenFile(FILE **fd, char **fileName)
else
sprintf(buf, "%s%d.html", FileRoot, fileId);
if (*fileName) delete[] *fileName;
*fileName = copystring(FileNameFromPath(buf));
*fileName = copystring(wxFileNameFromPath(buf));
*fd = fopen(buf, "w");
fprintf(*fd, "<HTML>\n");
}
@@ -426,13 +426,13 @@ void AddBrowseButtons(char *upLabel, char *upFilename,
if (truncateFilenames)
{
char buf1[80];
strcpy(buf1, ConvertCase(FileNameFromPath(FileRoot)));
strcpy(buf1, ConvertCase(wxFileNameFromPath(FileRoot)));
sprintf(buf, "\n<A HREF=\"%s.%s\">%s</A> ", buf1, ConvertCase("htm"), contentsReference);
}
else
{
char buf1[80];
strcpy(buf1, ConvertCase(FileNameFromPath(FileRoot)));
strcpy(buf1, ConvertCase(wxFileNameFromPath(FileRoot)));
sprintf(buf, "\n<A HREF=\"%s%s\">%s</A> ", buf1, ConvertCase("_contents.html"), contentsReference);
}
// TexOutput("<NOFRAMES>");
@@ -585,13 +585,16 @@ char *ParseColourString(char *bkStr, bool *isPicture)
void OutputFont(void)
{
// Output <FONT FACE=...>
TexOutput("<FONT FACE=\"");
// Only output <font face> if explicitly requested by htmlFaceName= directive in
// tex2rtf.ini. Otherwise do NOT set the font because we want to use browser's
// default font:
if (htmlFaceName)
TexOutput(htmlFaceName);
else
TexOutput("Times New Roman");
TexOutput("\">\n");
{
// Output <FONT FACE=...>
TexOutput("<FONT FACE=\"");
TexOutput(htmlFaceName);
TexOutput("\">\n");
}
}
// Output start of <BODY> block
@@ -708,9 +711,9 @@ void HTMLOnMacro(int macroId, int no_args, bool start)
char titleBuf[200];
if (truncateFilenames)
sprintf(titleBuf, "%s.htm", FileNameFromPath(FileRoot));
sprintf(titleBuf, "%s.htm", wxFileNameFromPath(FileRoot));
else
sprintf(titleBuf, "%s_contents.html", FileNameFromPath(FileRoot));
sprintf(titleBuf, "%s_contents.html", wxFileNameFromPath(FileRoot));
fprintf(Chapters, "<A NAME=\"%s\"></A>", topicName);
@@ -2708,9 +2711,9 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start)
char titleBuf[150];
if (truncateFilenames)
sprintf(titleBuf, "%s.htm", FileNameFromPath(FileRoot));
sprintf(titleBuf, "%s.htm", wxFileNameFromPath(FileRoot));
else
sprintf(titleBuf, "%s_contents.html", FileNameFromPath(FileRoot));
sprintf(titleBuf, "%s_contents.html", wxFileNameFromPath(FileRoot));
HTMLHead();
TexOutput("<title>");
@@ -2919,7 +2922,7 @@ bool HTMLGo(void)
OnError("Cannot open output file!");
return FALSE;
}
AddTexRef("contents", FileNameFromPath(TitlepageName), ContentsNameString);
AddTexRef("contents", wxFileNameFromPath(TitlepageName), ContentsNameString);
fprintf(Contents, "<P><P><H2>%s</H2><P><P>\n", ContentsNameString);
@@ -3003,7 +3006,7 @@ bool HTMLGo(void)
if (contentsString)
fprintf(tmpTitle, "<TITLE>%s</TITLE></HEAD>\n\n", contentsString);
else
fprintf(tmpTitle, "<TITLE>%s</TITLE></HEAD>\n\n", FileNameFromPath(FileRoot));
fprintf(tmpTitle, "<TITLE>%s</TITLE></HEAD>\n\n", wxFileNameFromPath(FileRoot));
}
// Output frame information
@@ -3017,8 +3020,8 @@ bool HTMLGo(void)
fprintf(tmpTitle, "<FRAMESET COLS=\"30%%,70%%\">\n");
fprintf(tmpTitle, "<FRAME SRC=\"%s\">\n", ConvertCase(FileNameFromPath(contentsFrameName)));
fprintf(tmpTitle, "<FRAME SRC=\"%s\" NAME=\"mainwindow\">\n", ConvertCase(FileNameFromPath(firstFileName)));
fprintf(tmpTitle, "<FRAME SRC=\"%s\">\n", ConvertCase(wxFileNameFromPath(contentsFrameName)));
fprintf(tmpTitle, "<FRAME SRC=\"%s\" NAME=\"mainwindow\">\n", ConvertCase(wxFileNameFromPath(firstFileName)));
fprintf(tmpTitle, "</FRAMESET>\n");
fprintf(tmpTitle, "<NOFRAMES>\n");
@@ -3049,7 +3052,7 @@ bool HTMLGo(void)
fprintf(tmpTitle, "\n</HTML>\n");
fclose(tmpTitle);
if (FileExists(TitlepageName)) wxRemoveFile(TitlepageName);
if (wxFileExists(TitlepageName)) wxRemoveFile(TitlepageName);
if (!wxRenameFile("title.tmp", TitlepageName))
{
wxCopyFile("title.tmp", TitlepageName);
@@ -3062,7 +3065,7 @@ bool HTMLGo(void)
if (lastTopic) delete[] lastTopic;
lastTopic = NULL;
if (FileExists(ContentsName)) wxRemoveFile(ContentsName);
if (wxFileExists(ContentsName)) wxRemoveFile(ContentsName);
if (!wxRenameFile(TmpContentsName, ContentsName))
{
@@ -3147,11 +3150,11 @@ void GenerateHTMLWorkshopFiles(char *fname)
"Default topic=%s\n"
"Index file=%s.hhk\n"
"Title=",
FileNameFromPath(fname),
FileNameFromPath(fname),
FileNameFromPath(fname),
FileNameFromPath(TitlepageName),
FileNameFromPath(fname)
wxFileNameFromPath(fname),
wxFileNameFromPath(fname),
wxFileNameFromPath(fname),
wxFileNameFromPath(TitlepageName),
wxFileNameFromPath(fname)
);
if (DocumentTitle) {
@@ -3162,19 +3165,19 @@ void GenerateHTMLWorkshopFiles(char *fname)
fprintf(f, "\n\n[WINDOWS]\n"
"%sHelp=,\"%s.hhc\",\"%s.hhk\",\"%s\",,,,,,0x2420,,0x380e,,,,,0,,,",
FileNameFromPath(fname),
FileNameFromPath(fname),
FileNameFromPath(fname),
FileNameFromPath(TitlepageName));
wxFileNameFromPath(fname),
wxFileNameFromPath(fname),
wxFileNameFromPath(fname),
wxFileNameFromPath(TitlepageName));
fprintf(f, "\n\n[FILES]\n");
fprintf(f, "%s\n", FileNameFromPath(TitlepageName));
fprintf(f, "%s\n", wxFileNameFromPath(TitlepageName));
for (int i = 1; i <= fileId; i++) {
if (truncateFilenames)
sprintf(buf, "%s%d.htm", FileNameFromPath(FileRoot), i);
sprintf(buf, "%s%d.htm", wxFileNameFromPath(FileRoot), i);
else
sprintf(buf, "%s%d.html", FileNameFromPath(FileRoot), i);
sprintf(buf, "%s%d.html", wxFileNameFromPath(FileRoot), i);
fprintf(f, "%s\n", buf);
}
fclose(f);
@@ -3278,7 +3281,7 @@ void HTMLWorkshopStartContents()
"<LI> <OBJECT type=\"text/sitemap\">\n"
"<param name=\"Local\" value=\"%s\">\n"
"<param name=\"Name\" value=\"Contents\">\n</OBJECT>\n",
FileNameFromPath(TitlepageName)
wxFileNameFromPath(TitlepageName)
);
}

View File

@@ -11,7 +11,7 @@
# of Tex2RTF, so I set off to give it a try... I found out it would crash
# when submitted to a certain LaTeX file I created. I wanted to find out why,
# so I went on and worked on compiling on my PC: Windows NT 4.0 beta, Visual
# C++ 4.1a. Since all I was interested on was the convertion utility, I tried
# C++ 4.1a. Since all I was interested on was the conversion utility, I tried
# to make it work without a GUI. It didn't compile immediately, but after a
# few small changes it now works like a charm. Unfortunately it doesn't crash
# anymore, so I can't tell why it used to... Anyway, I wanted to contribute

View File

@@ -527,7 +527,7 @@ bool WriteHPJ(char *filename)
StripExtension(hpjFilename);
strcat(hpjFilename, ".hpj");
strcpy(helpFile, FileNameFromPath(filename));
strcpy(helpFile, wxFileNameFromPath(filename));
StripExtension(helpFile);
strcpy(rtfFile, helpFile);
strcat(helpFile, ".hlp");
@@ -1195,7 +1195,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
fprintf(Chapters, "!{\\footnote DisableButton(\"Up\")}\n");
else
fprintf(Chapters, "!{\\footnote EnableButton(\"Up\");ChangeButtonBinding(\"Up\", \"JumpId(`%s.hlp', `%s')\")}\n",
FileNameFromPath(FileRoot), "Contents");
wxFileNameFromPath(FileRoot), "Contents");
}
}
@@ -1350,12 +1350,12 @@ void RTFOnMacro(int macroId, int no_args, bool start)
if (DocumentStyle == LATEX_ARTICLE)
{
fprintf(Sections, "!{\\footnote EnableButton(\"Up\");ChangeButtonBinding(\"Up\", \"JumpId(`%s.hlp', `%s')\")}\n",
FileNameFromPath(FileRoot), "Contents");
wxFileNameFromPath(FileRoot), "Contents");
}
else if (CurrentChapterName)
{
fprintf(Sections, "!{\\footnote EnableButton(\"Up\");ChangeButtonBinding(\"Up\", \"JumpId(`%s.hlp', `%s')\")}\n",
FileNameFromPath(FileRoot), CurrentChapterName);
wxFileNameFromPath(FileRoot), CurrentChapterName);
}
}
}
@@ -1501,7 +1501,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
if (useUpButton && CurrentSectionName)
{
fprintf(Subsections, "!{\\footnote EnableButton(\"Up\");ChangeButtonBinding(\"Up\", \"JumpId(`%s.hlp', `%s')\")}\n",
FileNameFromPath(FileRoot), CurrentSectionName);
wxFileNameFromPath(FileRoot), CurrentSectionName);
}
}
if (!winHelp && indexSubsections && useWord)
@@ -1647,7 +1647,7 @@ void RTFOnMacro(int macroId, int no_args, bool start)
if (useUpButton && CurrentSubsectionName)
{
fprintf(Subsubsections, "!{\\footnote EnableButton(\"Up\");ChangeButtonBinding(\"Up\", \"JumpId(`%s.hlp', `%s')\")}\n",
FileNameFromPath(FileRoot), CurrentSubsectionName);
wxFileNameFromPath(FileRoot), CurrentSubsectionName);
}
}
if (!winHelp && indexSubsections && useWord)
@@ -4897,7 +4897,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
if (useUpButton)
{
fprintf(Chapters, "!{\\footnote EnableButton(\"Up\");ChangeButtonBinding(\"Up\", \"JumpId(`%s.hlp', `%s')\")}\n",
FileNameFromPath(FileRoot), "Contents");
wxFileNameFromPath(FileRoot), "Contents");
}
}
@@ -5247,7 +5247,7 @@ bool RTFGo(void)
{
wxConcatFiles("header.rtf", "chapters.rtf", "tmp1.rtf");
Tex2RTFYield(TRUE);
if (FileExists(OutputFile))
if (wxFileExists(OutputFile))
wxRemoveFile(OutputFile);
char *cwdStr;
@@ -5273,7 +5273,7 @@ bool RTFGo(void)
wxRemoveFile("tmp1.rtf");
}
if (FileExists(ContentsName)) wxRemoveFile(ContentsName);
if (wxFileExists(ContentsName)) wxRemoveFile(ContentsName);
if (!wxRenameFile(TmpContentsName, ContentsName))
{

View File

@@ -146,7 +146,7 @@ char *followedLinkColourString = NULL;
bool combineSubSections = FALSE;
bool htmlWorkshopFiles = FALSE;
bool ignoreBadRefs = FALSE;
char *htmlFaceName = copystring("Times New Roman");
char *htmlFaceName = NULL;
extern int passNumber;
@@ -750,7 +750,7 @@ bool read_a_line(char *buf)
fileNameStr.Replace("\\", "");
// Ignore some types of input files (e.g. macro definition files)
char *fileOnly = FileNameFromPath((char*) (const char*) fileNameStr);
char *fileOnly = wxFileNameFromPath((char*) (const char*) fileNameStr);
currentFileName = fileOnly;
if (IgnorableInputFiles.Member(fileOnly))
return read_a_line(buf);

View File

@@ -173,6 +173,10 @@ int GetCurrentColumn(void); // number of characters on current line
char *ConvertCase(char *s); // Convert case, according to upperCaseNames setting.
extern wxPathList TexPathList; // Path list, can be used for file searching.
#if !WXWIN_COMPATIBILITY_2
extern bool StringMatch(const wxChar *one, const wxChar *two, bool subString = TRUE, bool exact = FALSE);
#endif
// Define a variable value from the .ini file
char *RegisterSetting(char *settingName, char *settingValue, bool interactive = TRUE);

View File

@@ -330,7 +330,7 @@ bool MyApp::OnInit()
if (InputFile)
{
sprintf(buf, "Tex2RTF [%s]", FileNameFromPath(InputFile));
sprintf(buf, "Tex2RTF [%s]", wxFileNameFromPath(InputFile));
frame->SetTitle(buf);
}
@@ -967,7 +967,7 @@ bool Go(void)
if (InputFile && OutputFile)
{
if (!FileExists(InputFile))
if (!wxFileExists(InputFile))
{
OnError("Cannot open input file!");
TexCleanUp();

View File

@@ -36,6 +36,7 @@
#else
#include <iostream>
#include <fstream>
using namespace std;
#endif
#include <ctype.h>
@@ -1143,7 +1144,7 @@ char *RegisterSetting(char *settingName, char *settingValue, bool interactive)
else if (StringMatch(settingName, "authorFontSize", FALSE, TRUE))
StringToInt(settingValue, &authorFont);
else if (StringMatch(settingName, "ignoreInput", FALSE, TRUE))
IgnorableInputFiles.Add(FileNameFromPath(settingValue));
IgnorableInputFiles.Add(wxFileNameFromPath(settingValue));
else if (StringMatch(settingName, "mirrorMargins", FALSE, TRUE))
mirrorMargins = StringTobool(settingValue);
else if (StringMatch(settingName, "runTwice", FALSE, TRUE))
@@ -1671,3 +1672,25 @@ char *ConvertCase(char *s)
buf[i] = 0;
return buf;
}
#if !WXWIN_COMPATIBILITY_2
// if substring is TRUE, search for str1 in str2
bool StringMatch(const wxChar *str1, const wxChar *str2, bool subString,
bool exact)
{
if (subString)
{
wxString Sstr1(str1);
wxString Sstr2(str2);
if (!exact)
{
Sstr1.MakeUpper();
Sstr2.MakeUpper();
}
return Sstr2.Index(Sstr1) != wxNOT_FOUND;
}
else
return exact ? wxString(str2).Cmp(str1) == 0 :
wxString(str2).CmpNoCase(str1) == 0;
}
#endif

View File

@@ -1195,7 +1195,7 @@ bool XLPGo(void)
fclose(Subsubsections); Subsubsections = NULL;
fclose(Index); Index = NULL;
if (FileExists(ContentsName)) wxRemoveFile(ContentsName);
if (wxFileExists(ContentsName)) wxRemoveFile(ContentsName);
if (!wxRenameFile(TmpContentsName, ContentsName))
{