X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aed3314d6ebf4653928b513c5476c482b7b5180a..07ee782bb86ecf2a7e0b30e53246e4ebb269e3bd:/utils/tex2rtf/src/rtfutils.cpp?ds=sidebyside diff --git a/utils/tex2rtf/src/rtfutils.cpp b/utils/tex2rtf/src/rtfutils.cpp index a33c1628b8..55a0a1e04f 100644 --- a/utils/tex2rtf/src/rtfutils.cpp +++ b/utils/tex2rtf/src/rtfutils.cpp @@ -21,7 +21,6 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" #endif #include "tex2any.h" @@ -37,6 +36,11 @@ #include "bmputils.h" #include "table.h" +#if !WXWIN_COMPATIBILITY_2_4 +static inline wxChar* copystring(const wxChar* s) + { return wxStrcpy(new wxChar[wxStrlen(s) + 1], s); } +#endif + wxList itemizeStack; static int indentLevel = 0; static int forbidParindent = 0; // if > 0, no parindent (e.g. in center environment) @@ -527,7 +531,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 +1199,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 +1354,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 +1505,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 +1651,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) @@ -2205,7 +2209,6 @@ void RTFOnMacro(int macroId, int no_args, bool start) { struc->currentItem += 1; - int indentSize = struc->indentation; int oldIndent = 0; wxNode *node2 = NULL; if (itemizeStack.Number() > 1) // TODO: do I actually mean Nth(0) here?? @@ -4898,7 +4901,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"); } } @@ -5248,7 +5251,7 @@ bool RTFGo(void) { wxConcatFiles("header.rtf", "chapters.rtf", "tmp1.rtf"); Tex2RTFYield(TRUE); - if (FileExists(OutputFile)) + if (wxFileExists(OutputFile)) wxRemoveFile(OutputFile); char *cwdStr; @@ -5274,7 +5277,7 @@ bool RTFGo(void) wxRemoveFile("tmp1.rtf"); } - if (FileExists(ContentsName)) wxRemoveFile(ContentsName); + if (wxFileExists(ContentsName)) wxRemoveFile(ContentsName); if (!wxRenameFile(TmpContentsName, ContentsName)) {