$NetBSD: patch-ae,v 1.1 2004/03/30 18:23:46 ben Exp $

--- texutils.cpp.orig	Mon Jul 15 15:54:47 2002
+++ texutils.cpp
@@ -619,7 +619,7 @@ bool ReadBib(char *filename)
       return FALSE;
     }
     BibEatWhiteSpace(istr);
-    if (StringMatch(recordType, "string", FALSE, TRUE))
+    if (wxStringMatch2(recordType, "string", FALSE, TRUE))
     {
       BibReadWord(istr, recordType);
       BibEatWhiteSpace(istr);
@@ -696,57 +696,57 @@ bool ReadBib(char *filename)
             BibReadValue(istr, fieldValue, TRUE, (ch == '"' ? TRUE : FALSE));
 
           // Now we can add a field
-          if (StringMatch(recordField, "author", FALSE, TRUE))
+          if (wxStringMatch2(recordField, "author", FALSE, TRUE))
             bibEntry->author = copystring(fieldValue);
-          else if (StringMatch(recordField, "key", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "key", FALSE, TRUE))
             {}
-          else if (StringMatch(recordField, "annotate", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "annotate", FALSE, TRUE))
             {}
-          else if (StringMatch(recordField, "abstract", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "abstract", FALSE, TRUE))
             {}
-          else if (StringMatch(recordField, "edition", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "edition", FALSE, TRUE))
             {}
-          else if (StringMatch(recordField, "howpublished", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "howpublished", FALSE, TRUE))
             {}
-          else if (StringMatch(recordField, "note", FALSE, TRUE) || StringMatch(recordField, "notes", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "note", FALSE, TRUE) || wxStringMatch2(recordField, "notes", FALSE, TRUE))
             {}
-          else if (StringMatch(recordField, "series", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "series", FALSE, TRUE))
             {}
-          else if (StringMatch(recordField, "type", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "type", FALSE, TRUE))
             {}
-          else if (StringMatch(recordField, "keywords", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "keywords", FALSE, TRUE))
             {}
-          else if (StringMatch(recordField, "editor", FALSE, TRUE) || StringMatch(recordField, "editors", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "editor", FALSE, TRUE) || wxStringMatch2(recordField, "editors", FALSE, TRUE))
             bibEntry->editor= copystring(fieldValue);
-          else if (StringMatch(recordField, "title", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "title", FALSE, TRUE))
             bibEntry->title= copystring(fieldValue);
-          else if (StringMatch(recordField, "booktitle", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "booktitle", FALSE, TRUE))
             bibEntry->booktitle= copystring(fieldValue);
-          else if (StringMatch(recordField, "journal", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "journal", FALSE, TRUE))
             bibEntry->journal= copystring(fieldValue);
-          else if (StringMatch(recordField, "volume", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "volume", FALSE, TRUE))
             bibEntry->volume= copystring(fieldValue);
-          else if (StringMatch(recordField, "number", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "number", FALSE, TRUE))
             bibEntry->number= copystring(fieldValue);
-          else if (StringMatch(recordField, "year", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "year", FALSE, TRUE))
             bibEntry->year= copystring(fieldValue);
-          else if (StringMatch(recordField, "month", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "month", FALSE, TRUE))
             bibEntry->month= copystring(fieldValue);
-          else if (StringMatch(recordField, "pages", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "pages", FALSE, TRUE))
             bibEntry->pages= copystring(fieldValue);
-          else if (StringMatch(recordField, "publisher", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "publisher", FALSE, TRUE))
             bibEntry->publisher= copystring(fieldValue);
-          else if (StringMatch(recordField, "address", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "address", FALSE, TRUE))
             bibEntry->address= copystring(fieldValue);
-          else if (StringMatch(recordField, "institution", FALSE, TRUE) || StringMatch(recordField, "school", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "institution", FALSE, TRUE) || wxStringMatch2(recordField, "school", FALSE, TRUE))
             bibEntry->institution= copystring(fieldValue);
-          else if (StringMatch(recordField, "organization", FALSE, TRUE) || StringMatch(recordField, "organisation", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "organization", FALSE, TRUE) || wxStringMatch2(recordField, "organisation", FALSE, TRUE))
             bibEntry->organization= copystring(fieldValue);
-          else if (StringMatch(recordField, "comment", FALSE, TRUE) || StringMatch(recordField, "comments", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "comment", FALSE, TRUE) || wxStringMatch2(recordField, "comments", FALSE, TRUE))
             bibEntry->comment= copystring(fieldValue);
-          else if (StringMatch(recordField, "annote", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "annote", FALSE, TRUE))
             bibEntry->comment= copystring(fieldValue);
-          else if (StringMatch(recordField, "chapter", FALSE, TRUE))
+          else if (wxStringMatch2(recordField, "chapter", FALSE, TRUE))
             bibEntry->chapter= copystring(fieldValue);
           else
           {
@@ -797,7 +797,7 @@ void OutputBibItem(TexRef *ref, BibEntry
   if (bib->year || bib->month)
     TexOutput(". ");
 
-  if (StringMatch(bib->type, "article", FALSE, TRUE))
+  if (wxStringMatch2(bib->type, "article", FALSE, TRUE))
   {
     if (bib->title)
     {
@@ -834,14 +834,14 @@ void OutputBibItem(TexRef *ref, BibEntry
     }
     TexOutput(".");
   }
-  else if (StringMatch(bib->type, "book", FALSE, TRUE) ||
-           StringMatch(bib->type, "unpublished", FALSE, TRUE) ||
-           StringMatch(bib->type, "manual", FALSE, TRUE) ||
-           StringMatch(bib->type, "phdthesis", FALSE, TRUE) ||
-           StringMatch(bib->type, "mastersthesis", FALSE, TRUE) ||
-           StringMatch(bib->type, "misc", FALSE, TRUE) ||
-           StringMatch(bib->type, "techreport", FALSE, TRUE) ||
-           StringMatch(bib->type, "booklet", FALSE, TRUE))
+  else if (wxStringMatch2(bib->type, "book", FALSE, TRUE) ||
+           wxStringMatch2(bib->type, "unpublished", FALSE, TRUE) ||
+           wxStringMatch2(bib->type, "manual", FALSE, TRUE) ||
+           wxStringMatch2(bib->type, "phdthesis", FALSE, TRUE) ||
+           wxStringMatch2(bib->type, "mastersthesis", FALSE, TRUE) ||
+           wxStringMatch2(bib->type, "misc", FALSE, TRUE) ||
+           wxStringMatch2(bib->type, "techreport", FALSE, TRUE) ||
+           wxStringMatch2(bib->type, "booklet", FALSE, TRUE))
   {
     if (bib->title || bib->booktitle)
     {
@@ -852,9 +852,9 @@ void OutputBibItem(TexRef *ref, BibEntry
       OnArgument(ltIT, 1, FALSE);
       OnMacro(ltIT, 1, FALSE);
     }
-    if (StringMatch(bib->type, "phdthesis", FALSE, TRUE))
+    if (wxStringMatch2(bib->type, "phdthesis", FALSE, TRUE))
       TexOutput("PhD thesis. ");
-    if (StringMatch(bib->type, "techreport", FALSE, TRUE))
+    if (wxStringMatch2(bib->type, "techreport", FALSE, TRUE))
       TexOutput("Technical report. ");
     if (bib->editor)
     {
@@ -883,10 +883,10 @@ void OutputBibItem(TexRef *ref, BibEntry
       TexOutput(". ");
     }
   }
-  else if (StringMatch(bib->type, "inbook", FALSE, TRUE) ||
-           StringMatch(bib->type, "inproceedings", FALSE, TRUE) ||
-           StringMatch(bib->type, "incollection", FALSE, TRUE) ||
-           StringMatch(bib->type, "conference", FALSE, TRUE))
+  else if (wxStringMatch2(bib->type, "inbook", FALSE, TRUE) ||
+           wxStringMatch2(bib->type, "inproceedings", FALSE, TRUE) ||
+           wxStringMatch2(bib->type, "incollection", FALSE, TRUE) ||
+           wxStringMatch2(bib->type, "conference", FALSE, TRUE))
   {
     if (bib->title)
     {
@@ -1067,151 +1067,151 @@ char *RegisterSetting(char *settingName,
 {
   static char errorCode[100];
   strcpy(errorCode, "OK");
-  if (StringMatch(settingName, "chapterName", FALSE, TRUE))
+  if (wxStringMatch2(settingName, "chapterName", FALSE, TRUE))
   {
     delete[] ChapterNameString;
     ChapterNameString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "sectionName", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "sectionName", FALSE, TRUE))
   {
     delete[] SectionNameString;
     SectionNameString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "subsectionName", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "subsectionName", FALSE, TRUE))
   {
     delete[] SubsectionNameString;
     SubsectionNameString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "subsubsectionName", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "subsubsectionName", FALSE, TRUE))
   {
     delete[] SubsubsectionNameString;
     SubsubsectionNameString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "indexName", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "indexName", FALSE, TRUE))
   {
     delete[] IndexNameString;
     IndexNameString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "contentsName", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "contentsName", FALSE, TRUE))
   {
     delete[] ContentsNameString;
     ContentsNameString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "glossaryName", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "glossaryName", FALSE, TRUE))
   {
     delete[] GlossaryNameString;
     GlossaryNameString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "referencesName", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "referencesName", FALSE, TRUE))
   {
     delete[] ReferencesNameString;
     ReferencesNameString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "tablesName", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "tablesName", FALSE, TRUE))
   {
     delete[] TablesNameString;
     TablesNameString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "figuresName", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "figuresName", FALSE, TRUE))
   {
     delete[] FiguresNameString;
     FiguresNameString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "tableName", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "tableName", FALSE, TRUE))
   {
     delete[] TableNameString;
     TableNameString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "figureName", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "figureName", FALSE, TRUE))
   {
     delete[] FigureNameString;
     FigureNameString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "abstractName", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "abstractName", FALSE, TRUE))
   {
     delete[] AbstractNameString;
     AbstractNameString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "chapterFontSize", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "chapterFontSize", FALSE, TRUE))
     StringToInt(settingValue, &chapterFont);
-  else if (StringMatch(settingName, "sectionFontSize", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "sectionFontSize", FALSE, TRUE))
     StringToInt(settingValue, &sectionFont);
-  else if (StringMatch(settingName, "subsectionFontSize", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "subsectionFontSize", FALSE, TRUE))
     StringToInt(settingValue, &subsectionFont);
-  else if (StringMatch(settingName, "titleFontSize", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "titleFontSize", FALSE, TRUE))
     StringToInt(settingValue, &titleFont);
-  else if (StringMatch(settingName, "authorFontSize", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "authorFontSize", FALSE, TRUE))
     StringToInt(settingValue, &authorFont);
-  else if (StringMatch(settingName, "ignoreInput", FALSE, TRUE))
-    IgnorableInputFiles.Add(FileNameFromPath(settingValue));
-  else if (StringMatch(settingName, "mirrorMargins", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "ignoreInput", FALSE, TRUE))
+    IgnorableInputFiles.Add(wxFileNameFromPath(settingValue));
+  else if (wxStringMatch2(settingName, "mirrorMargins", FALSE, TRUE))
     mirrorMargins = StringTobool(settingValue);
-  else if (StringMatch(settingName, "runTwice", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "runTwice", FALSE, TRUE))
     runTwice = StringTobool(settingValue);
-  else if (StringMatch(settingName, "isInteractive", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "isInteractive", FALSE, TRUE))
     isInteractive = StringTobool(settingValue);
-  else if (StringMatch(settingName, "headerRule", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "headerRule", FALSE, TRUE))
     headerRule = StringTobool(settingValue);
-  else if (StringMatch(settingName, "footerRule", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "footerRule", FALSE, TRUE))
     footerRule = StringTobool(settingValue);
-  else if (StringMatch(settingName, "combineSubSections", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "combineSubSections", FALSE, TRUE))
     combineSubSections = StringTobool(settingValue);
-  else if (StringMatch(settingName, "listLabelIndent", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "listLabelIndent", FALSE, TRUE))
     StringToInt(settingValue, &labelIndentTab);
-  else if (StringMatch(settingName, "listItemIndent", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "listItemIndent", FALSE, TRUE))
     StringToInt(settingValue, &itemIndentTab);
-  else if (StringMatch(settingName, "useUpButton", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "useUpButton", FALSE, TRUE))
     useUpButton = StringTobool(settingValue);
-  else if (StringMatch(settingName, "useHeadingStyles", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "useHeadingStyles", FALSE, TRUE))
     useHeadingStyles = StringTobool(settingValue);
-  else if (StringMatch(settingName, "useWord", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "useWord", FALSE, TRUE))
     useWord = StringTobool(settingValue);
-  else if (StringMatch(settingName, "contentsDepth", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "contentsDepth", FALSE, TRUE))
     StringToInt(settingValue, &contentsDepth);
-  else if (StringMatch(settingName, "generateHPJ", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "generateHPJ", FALSE, TRUE))
     generateHPJ = StringTobool(settingValue);
-  else if (StringMatch(settingName, "truncateFilenames", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "truncateFilenames", FALSE, TRUE))
     truncateFilenames = StringTobool(settingValue);
-  else if (StringMatch(settingName, "winHelpVersion", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "winHelpVersion", FALSE, TRUE))
     StringToInt(settingValue, &winHelpVersion);
-  else if (StringMatch(settingName, "winHelpContents", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "winHelpContents", FALSE, TRUE))
     winHelpContents = StringTobool(settingValue);
-  else if (StringMatch(settingName, "htmlIndex", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "htmlIndex", FALSE, TRUE))
     htmlIndex = StringTobool(settingValue);
-  else if (StringMatch(settingName, "htmlWorkshopFiles", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "htmlWorkshopFiles", FALSE, TRUE))
     htmlWorkshopFiles = StringTobool(settingValue);
-  else if (StringMatch(settingName, "htmlFrameContents", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "htmlFrameContents", FALSE, TRUE))
     htmlFrameContents = StringTobool(settingValue);
-  else if (StringMatch(settingName, "htmlStylesheet", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "htmlStylesheet", FALSE, TRUE))
     {
       if (htmlStylesheet) delete[] htmlStylesheet;
       htmlStylesheet = copystring(settingValue);
     }
-  else if (StringMatch(settingName, "upperCaseNames", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "upperCaseNames", FALSE, TRUE))
     upperCaseNames = StringTobool(settingValue);
-  else if (StringMatch(settingName, "ignoreBadRefs", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "ignoreBadRefs", FALSE, TRUE))
     ignoreBadRefs = StringTobool(settingValue);
-  else if (StringMatch(settingName, "htmlFaceName", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "htmlFaceName", FALSE, TRUE))
   {
     delete[] htmlFaceName;
     htmlFaceName = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "winHelpTitle", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "winHelpTitle", FALSE, TRUE))
   {
     if (winHelpTitle)
       delete[] winHelpTitle;
     winHelpTitle = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "indexSubsections", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "indexSubsections", FALSE, TRUE))
     indexSubsections = StringTobool(settingValue);
-  else if (StringMatch(settingName, "compatibility", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "compatibility", FALSE, TRUE))
     compatibilityMode = StringTobool(settingValue);
-  else if (StringMatch(settingName, "defaultColumnWidth", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "defaultColumnWidth", FALSE, TRUE))
   {
     StringToInt(settingValue, &defaultTableColumnWidth);
     defaultTableColumnWidth = 20*defaultTableColumnWidth;
   }
-  else if (StringMatch(settingName, "bitmapMethod", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "bitmapMethod", FALSE, TRUE))
   {
     if ((strcmp(settingValue, "includepicture") != 0) && (strcmp(settingValue, "hex") != 0) &&
         (strcmp(settingValue, "import") != 0))
@@ -1226,7 +1226,7 @@ char *RegisterSetting(char *settingName,
       bitmapMethod = copystring(settingValue);
     }
   }
-  else if (StringMatch(settingName, "htmlBrowseButtons", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "htmlBrowseButtons", FALSE, TRUE))
   {
     if (strcmp(settingValue, "none") == 0)
       htmlBrowseButtons = HTML_BUTTONS_NONE;
@@ -1241,43 +1241,43 @@ char *RegisterSetting(char *settingName,
       strcpy(errorCode, "Initialisation file error: htmlBrowseButtons must be one of none, bitmap, or text.");
     }
   }
-  else if (StringMatch(settingName, "backgroundImage", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "backgroundImage", FALSE, TRUE))
   {
     backgroundImageString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "backgroundColour", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "backgroundColour", FALSE, TRUE))
   {
     delete[] backgroundColourString;
     backgroundColourString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "textColour", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "textColour", FALSE, TRUE))
   {
     textColourString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "linkColour", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "linkColour", FALSE, TRUE))
   {
     linkColourString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "followedLinkColour", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "followedLinkColour", FALSE, TRUE))
   {
     followedLinkColourString = copystring(settingValue);
   }
-  else if (StringMatch(settingName, "conversionMode", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "conversionMode", FALSE, TRUE))
   {
-    if (StringMatch(settingValue, "RTF", FALSE, TRUE))
+    if (wxStringMatch2(settingValue, "RTF", FALSE, TRUE))
     {
       winHelp = FALSE; convertMode = TEX_RTF;
     }
-    else if (StringMatch(settingValue, "WinHelp", FALSE, TRUE))
+    else if (wxStringMatch2(settingValue, "WinHelp", FALSE, TRUE))
     {
       winHelp = TRUE; convertMode = TEX_RTF;
     }
-    else if (StringMatch(settingValue, "XLP", FALSE, TRUE) ||
-             StringMatch(settingValue, "wxHelp", FALSE, TRUE))
+    else if (wxStringMatch2(settingValue, "XLP", FALSE, TRUE) ||
+             wxStringMatch2(settingValue, "wxHelp", FALSE, TRUE))
     {
       convertMode = TEX_XLP;
     }
-    else if (StringMatch(settingValue, "HTML", FALSE, TRUE))
+    else if (wxStringMatch2(settingValue, "HTML", FALSE, TRUE))
     {
       convertMode = TEX_HTML;
     }
@@ -1288,7 +1288,7 @@ char *RegisterSetting(char *settingName,
       strcpy(errorCode, "Initialisation file error: conversionMode must be one of\nRTF, WinHelp, XLP (or wxHelp), HTML.");
     }
   }
-  else if (StringMatch(settingName, "documentFontSize", FALSE, TRUE))
+  else if (wxStringMatch2(settingName, "documentFontSize", FALSE, TRUE))
   {
     int n;
     StringToInt(settingValue, &n);
