]> git.saurik.com Git - wxWidgets.git/commitdiff
Added ignoreBadRefs so e.g. the PMF manual doesn't generate bad references to
authorJulian Smart <julian@anthemion.co.uk>
Thu, 3 Jan 2002 18:23:35 +0000 (18:23 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 3 Jan 2002 18:23:35 +0000 (18:23 +0000)
wxWindows classes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

utils/tex2rtf/docs/tex2rtf.tex
utils/tex2rtf/src/htmlutil.cpp
utils/tex2rtf/src/rtfutils.cpp
utils/tex2rtf/src/tex2any.cpp
utils/tex2rtf/src/tex2any.h
utils/tex2rtf/src/texutils.cpp

index 84bdee739e4094dbd9015387af9dc93042589ebd..32c15059cda584f2b88061f3348f78567133e36e 100644 (file)
@@ -577,6 +577,9 @@ are followed, e.g. use of $\backslash${\tt row} command in tabular environment.}
 The only default filename in the list is {\tt psbox.tex}.}
 \twocolitem{\inioption{isInteractive}}{If true, runs in interactive mode (the default).}
 \twocolitem{\inioption{runTwice}}{If true, runs the converter twice.}
+\twocolitem{\inioption{ignoreBadRefs}}{If true (or yes), ignores bad helpref references
+and simply writes the text in the first argument. Useful when a program such as HelpGen
+generates references to classes documented in another manual.}
 \end{twocollist}
 
 \subsubsection{Presentation options}\index{options, presentation}%
index c91ca52c9f4c7696c2d34225ce95a6970ca48ba0..b85e33f4a4f6f9155b65bd15e73c8982741caa82 100644 (file)
@@ -1906,7 +1906,8 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start)
           {
             if (helpRefText)
               TraverseChildrenFromChunk(helpRefText);
-            TexOutput(" (REF NOT FOUND)");
+            if (!ignoreBadRefs)
+              TexOutput(" (REF NOT FOUND)");
             wxString errBuf;
             errBuf.Printf("Warning: unresolved reference '%s'", refName);
             OnInform((char *)errBuf.c_str());
index 49c710c82ac5f340f1d4dfe0986ef9e10ba0faa5..3e0d934b9e2bf84c85a5054ded91b09fc67717e4 100644 (file)
@@ -59,10 +59,8 @@ extern char *RTFCharset;
 // This is defined in the Tex2Any library and isn't in use after parsing
 extern char *BigBuffer;
 
-
 extern wxHashTable TexReferences;
 
-
 // Are we in verbatim mode? If so, format differently.
 static bool inVerbatim = FALSE;
 
@@ -95,6 +93,8 @@ static int TwoColWidthB = 3000;
 
 const int PageWidth = 12242; // 8.25 inches wide for A4
 
+// Remember the anchor in a helpref
+static TexChunk *helpRefText = NULL;
 
 /*
  * Flag to say we've just issued a \par\pard command, so don't
@@ -3343,46 +3343,61 @@ bool RTFOnArgument(int macroId, int arg_no, bool start)
           TexOutput("{\\i ");
         else
           TexOutput("}");
+
+        if (start)
+          helpRefText = GetArgChunk();
+
         return TRUE;
       }
       else if ((GetNoArgs() - arg_no) == 0) // Arg = 2, or 3 if first is optional
       {
         if (macroId != ltHELPREFN)
         {
+          char *refName = GetArgData();
+          TexRef *texRef = NULL;
+          if (refName)
+            texRef = FindReference(refName);
           if (start)
           {
-            TexOutput(" (");
-            char *refName = GetArgData();
+            if (texRef || !ignoreBadRefs)
+              TexOutput(" (");
             if (refName)
             {
-                if (useWord)
+                if (texRef || !ignoreBadRefs)
                 {
-                    char *s = GetArgData();
-                    TexOutput("p. ");
-                    TexOutput("{\\field{\\*\\fldinst  PAGEREF ");
-                    TexOutput(refName);
-                    TexOutput(" \\\\* MERGEFORMAT }{\\fldrslt ??}}");
-                }
-                else
-                {
-                  // Only print section name if we're not in Word mode,
-                  // so can't do page references
-                  TexRef *texRef = FindReference(refName);
-                  if (texRef)
+                  if (useWord)
                   {
-                    TexOutput(texRef->sectionName) ; TexOutput(" "); TexOutput(texRef->sectionNumber);
+                      char *s = GetArgData();
+                      TexOutput("p. ");
+                      TexOutput("{\\field{\\*\\fldinst  PAGEREF ");
+                      TexOutput(refName);
+                      TexOutput(" \\\\* MERGEFORMAT }{\\fldrslt ??}}");
                   }
                   else
                   {
-                    TexOutput("??");
-                    sprintf(buf, "Warning: unresolved reference '%s'", refName);
-                    OnInform(buf);
+                    // Only print section name if we're not in Word mode,
+                    // so can't do page references
+                    if (texRef)
+                    {
+                      TexOutput(texRef->sectionName) ; TexOutput(" "); TexOutput(texRef->sectionNumber);
+                    }
+                    else
+                    {
+                      if (!ignoreBadRefs)
+                        TexOutput("??");
+                      sprintf(buf, "Warning: unresolved reference '%s'", refName);
+                      OnInform(buf);
+                    }
                   }
                 }
             }
             else TexOutput("??");
           }
-          else TexOutput(")");
+          else
+          {
+            if (texRef || !ignoreBadRefs)
+              TexOutput(")");
+          }
         }
         return FALSE;
       }
index 7f6227b77bdc5d7c4f4bb51496ecf01c3d257ba6..ed21d3e7f88fb1cd4ee996315cf999002c3be7ef 100644 (file)
@@ -144,6 +144,7 @@ char            *linkColourString = NULL;
 char            *followedLinkColourString = NULL;
 bool            combineSubSections = FALSE;
 bool            htmlWorkshopFiles = FALSE;
+bool            ignoreBadRefs = FALSE;
 
 extern int passNumber;
 
index fb9a2eab15dea1e1e2382e31988e2d7ec497ea38..5b2c6f4e55309758ccede08d02e3f29c93c8cf15 100644 (file)
@@ -248,6 +248,7 @@ extern char *linkColourString; // HTML link colour
 extern char *followedLinkColourString; // HTML followed link colour
 extern bool combineSubSections; // Stop splitting files below section
 extern bool htmlWorkshopFiles;  // generate HTML Help Workshop project files
+extern bool ignoreBadRefs;      // Don't insert (REF NOT FOUND)
 
 // Names to help with internationalisation
 extern char *ContentsNameString;
index 7aec24bfc4fbed648fd9ee1787d466b48ae30551..15364a1670ebee9db6171197d3c82f93d6958ddd 100644 (file)
@@ -1183,6 +1183,8 @@ char *RegisterSetting(char *settingName, char *settingValue, bool interactive)
     htmlFrameContents = StringTobool(settingValue);
   else if (StringMatch(settingName, "upperCaseNames", FALSE, TRUE))
     upperCaseNames = StringTobool(settingValue);
+  else if (StringMatch(settingName, "ignoreBadRefs", FALSE, TRUE))
+    ignoreBadRefs = StringTobool(settingValue);
   else if (StringMatch(settingName, "winHelpTitle", FALSE, TRUE))
   {
     if (winHelpTitle)