]> git.saurik.com Git - wxWidgets.git/commitdiff
Replaced wxBuffer with wxTex2RTFBuffer
authorJulian Smart <julian@anthemion.co.uk>
Fri, 22 Mar 2002 20:25:49 +0000 (20:25 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 22 Mar 2002 20:25:49 +0000 (20:25 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14732 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

utils/tex2rtf/src/htmlutil.cpp
utils/tex2rtf/src/rtfutils.cpp
utils/tex2rtf/src/tex2any.cpp
utils/tex2rtf/src/tex2any.h
utils/tex2rtf/src/tex2rtf.cpp

index 2ba127957600876c576f980b3ae44ecfd9e961af..7e3a6b8d6d06fd3f04512823b8708d3b5b39f307 100644 (file)
@@ -720,8 +720,8 @@ void HTMLOnMacro(int macroId, int no_args, bool start)
       // 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));
       }
     }
     break;
@@ -782,8 +782,8 @@ void HTMLOnMacro(int macroId, int no_args, bool start)
       // Add this section title to the list of keywords
       if (htmlIndex)
       {
-        OutputCurrentSectionToString(wxBuffer);
-        AddKeyWordForTopic(topicName, wxBuffer, currentFileName);
+        OutputCurrentSectionToString(wxTex2RTFBuffer);
+        AddKeyWordForTopic(topicName, wxTex2RTFBuffer, currentFileName);
       }
     }
     break;
@@ -889,8 +889,8 @@ void HTMLOnMacro(int macroId, int no_args, bool start)
           // Add this section title to the list of keywords
           if (htmlIndex)
           {
-            OutputCurrentSectionToString(wxBuffer);
-            AddKeyWordForTopic(topicName, wxBuffer, currentFileName);
+            OutputCurrentSectionToString(wxTex2RTFBuffer);
+            AddKeyWordForTopic(topicName, wxTex2RTFBuffer, currentFileName);
           }
 
       }
@@ -967,8 +967,8 @@ void HTMLOnMacro(int macroId, int no_args, bool start)
         // Add this section title to the list of keywords
         if (htmlIndex)
         {
-          OutputCurrentSectionToString(wxBuffer);
-          AddKeyWordForTopic(topicName, wxBuffer, currentFileName);
+          OutputCurrentSectionToString(wxTex2RTFBuffer);
+          AddKeyWordForTopic(topicName, wxTex2RTFBuffer, currentFileName);
         }
       }
     }
index 3e0d934b9e2bf84c85a5054ded91b09fc67717e4..a33c1628b8637ab9e89cdae83daad4caa624e0d2 100644 (file)
@@ -213,18 +213,18 @@ void ResetContentsLevels(int l)
 // : for space.
 void OutputSectionKeyword(FILE *fd)
 {
-  OutputCurrentSectionToString(wxBuffer);
+  OutputCurrentSectionToString(wxTex2RTFBuffer);
   
   unsigned int i;
-  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
-    else if ( wxBuffer[i] == '{' )
+    else if ( wxTex2RTFBuffer[i] == '{' )
         return;
 
   fprintf(fd, "K{\\footnote {K} ");
-  fprintf(fd, "%s", wxBuffer);
+  fprintf(fd, "%s", wxTex2RTFBuffer);
   
   fprintf(fd, "}\n");
 }
@@ -1113,8 +1113,8 @@ void RTFOnMacro(int macroId, int no_args, bool start)
 
       if (winHelpContents && winHelp && !InPopups())
       {
-        OutputCurrentSectionToString(wxBuffer);
-        WriteWinHelpContentsFileLine(topicName, wxBuffer, 1);
+        OutputCurrentSectionToString(wxTex2RTFBuffer);
+        WriteWinHelpContentsFileLine(topicName, wxTex2RTFBuffer, 1);
       }
       AddTexRef(topicName, NULL, ChapterNameString, chapterNo);
 
@@ -1255,8 +1255,8 @@ void RTFOnMacro(int macroId, int no_args, bool start)
       NotifyParentHasChildren(1);
       if (winHelpContents && winHelp && !InPopups())
       {
-        OutputCurrentSectionToString(wxBuffer);
-        WriteWinHelpContentsFileLine(topicName, wxBuffer, 2);
+        OutputCurrentSectionToString(wxTex2RTFBuffer);
+        WriteWinHelpContentsFileLine(topicName, wxTex2RTFBuffer, 2);
       }
       AddTexRef(topicName, NULL, SectionNameString, chapterNo, sectionNo);
 
@@ -1439,8 +1439,8 @@ void RTFOnMacro(int macroId, int no_args, bool start)
       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);
 
@@ -1589,8 +1589,8 @@ void RTFOnMacro(int macroId, int no_args, bool start)
       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);
 
index 8109c52f12b6693216cf83004aabb61588c6379d..51fdab5dbd83f42ad87f553f6593413429ed52bd 100644 (file)
@@ -1145,7 +1145,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, char *buffer, int pos, char *e
           pos ++;
           int noBraces = 1;
 
-          wxBuffer[0] = 0;
+          wxTex2RTFBuffer[0] = 0;
           int i = 0;
           bool end = FALSE;
           while (!end)
@@ -1156,37 +1156,37 @@ int ParseArg(TexChunk *thisArg, wxList& children, char *buffer, int pos, char *e
               noBraces --;
               if (noBraces == 0)
               {
-                wxBuffer[i] = 0;
+                wxTex2RTFBuffer[i] = 0;
                 end = TRUE;
               }
               else
               {
-                wxBuffer[i] = '}';
+                wxTex2RTFBuffer[i] = '}';
                 i ++;
               }
               pos ++;
             }
             else if (ch == '{')
             {
-              wxBuffer[i] = '{';
+              wxTex2RTFBuffer[i] = '{';
               i ++;
               pos ++;
             }
             else if (ch == '\\' && buffer[pos+1] == '}')
             {
-              wxBuffer[i] = '}';
+              wxTex2RTFBuffer[i] = '}';
               pos += 2;
               i++;
             }
             else if (ch == '\\' && buffer[pos+1] == '{')
             {
-              wxBuffer[i] = '{';
+              wxTex2RTFBuffer[i] = '{';
               pos += 2;
               i++;
             }
             else
             {
-              wxBuffer[i] = ch;
+              wxTex2RTFBuffer[i] = ch;
               pos ++;
               i ++;
               if (ch == 0)
@@ -1207,7 +1207,7 @@ int ParseArg(TexChunk *thisArg, wxList& children, char *buffer, int pos, char *e
           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);
         }
index 2bf36720159258f6d306a023609c3dc0165dc3bb..5280483dd39899c55cbdc10ee5576dad85c83967 100644 (file)
@@ -139,6 +139,7 @@ extern wxHashTable TopicTable;
 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
index 50b4466234068be1b5006e7c6c58d20fffa6aedf..a8cb70c961870e3ee02fe83a36adf15bc85b7795 100644 (file)
@@ -132,13 +132,9 @@ int BufSize = 500;
 bool Go(void);
 void ShowOptions(void);
 
-#ifdef NO_GUI
+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
+#ifdef NO_GUI
 
 int main(int argc, char **argv)
 #else
@@ -187,9 +183,6 @@ bool MyApp::OnInit()
   }
 
 #ifdef NO_GUI
-  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";
@@ -446,7 +439,6 @@ bool MyApp::OnInit()
   // Return the main frame window
   return TRUE;
 #else
-  delete[] wxBuffer;
   return FALSE;
 #endif
 }