Typecasting added to prevent warnings.

Instead of copying the temp file, if the temp file directory and output file directory for RTF are the same, program does a rename instead of a copy.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
George Tasker
2000-08-14 12:05:13 +00:00
parent 405c846fc4
commit 241c426ca8
2 changed files with 19 additions and 4 deletions

View File

@@ -210,7 +210,7 @@ void OutputSectionKeyword(FILE *fd)
{ {
OutputCurrentSectionToString(wxBuffer); OutputCurrentSectionToString(wxBuffer);
int i; unsigned int i;
for (i = 0; i < strlen(wxBuffer); i++) for (i = 0; i < strlen(wxBuffer); i++)
if (wxBuffer[i] == ':') if (wxBuffer[i] == ':')
wxBuffer[i] = ' '; wxBuffer[i] = ' ';
@@ -349,7 +349,7 @@ void GenerateKeywordsForTopic(char *topic)
SplitIndexEntry(s, buf1, buf2); SplitIndexEntry(s, buf1, buf2);
// Check for ':' which messes up index // Check for ':' which messes up index
int i; unsigned int i;
for (i = 0; i < strlen(buf1) ; i++) for (i = 0; i < strlen(buf1) ; i++)
if (buf1[i] == ':') if (buf1[i] == ':')
buf1[i] = ' '; buf1[i] = ' ';
@@ -5219,7 +5219,21 @@ bool RTFGo(void)
wxConcatFiles("header.rtf", "chapters.rtf", "tmp1.rtf"); wxConcatFiles("header.rtf", "chapters.rtf", "tmp1.rtf");
Tex2RTFYield(TRUE); Tex2RTFYield(TRUE);
if (FileExists(OutputFile)) wxRemoveFile(OutputFile); if (FileExists(OutputFile)) wxRemoveFile(OutputFile);
wxCopyFile("tmp1.rtf", OutputFile); wxString cwdStr, outputDirStr;
cwdStr = wxGetWorkingDirectory();
outputDirStr = wxPathOnly(OutputFile);
// Determine if the temp file and the output file are in the same directory,
// and if they are, then just rename the temp file rather than copying
// it, as this is much faster when working with large (multi-megabyte files)
if ((wxStrcmp(wxPathOnly(OutputFile),"") == 0) || // no path specified on output file
(wxStrcmp(wxGetWorkingDirectory(),wxPathOnly(OutputFile)) == 0)) // paths do not match
{
wxRenameFile("tmp1.rtf", OutputFile);
}
else
{
wxCopyFile("tmp1.rtf", OutputFile);
}
Tex2RTFYield(TRUE); Tex2RTFYield(TRUE);
wxRemoveFile("tmp1.rtf"); wxRemoveFile("tmp1.rtf");
} }

View File

@@ -1471,7 +1471,8 @@ bool TexLoadFile(char *filename)
if (Inputs[0]) fclose(Inputs[0]); if (Inputs[0]) fclose(Inputs[0]);
return TRUE; return TRUE;
} }
else return FALSE;
return FALSE;
} }
TexMacroDef::TexMacroDef(int the_id, char *the_name, int n, bool ig, bool forbidLevel) TexMacroDef::TexMacroDef(int the_id, char *the_name, int n, bool ig, bool forbidLevel)