]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/tex2rtf/src/rtfutils.cpp
Do not use wx/wx.h.
[wxWidgets.git] / utils / tex2rtf / src / rtfutils.cpp
index a33c1628b8637ab9e89cdae83daad4caa624e0d2..55a0a1e04f1b8f48018dd318467b648fb339ceea 100644 (file)
@@ -21,7 +21,6 @@
 #endif
 
 #ifndef WX_PRECOMP
-#include "wx/wx.h"
 #endif
 
 #include "tex2any.h"
 #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))
     {