Bug 12823 fixed: In help generation (toolbox) links were not correctly handled 84/12284/2
Calixte DENIZET [Fri, 16 Aug 2013 10:41:44 +0000 (12:41 +0200)]
Change-Id: I40da569d938726ec71f6eee4c8a847983938c3a6

scilab/CHANGES_5.5.X
scilab/modules/helptools/src/java/org/scilab/modules/helptools/HTMLDocbookTagConverter.java

index f6de4d5..2a3b911 100644 (file)
@@ -546,6 +546,9 @@ Bug fixes
 
 * Bug #12816 fixed - Numbers pasted in editvar were not parsed according to locale.
 
+* Bug #12823 fixed - In help generation (toolbox) links were not correctly handled.
+
 * Bug #12836 fixed - There was an error in strcmpi documentation.
 
 * Bug #12840 fixed - Fix typo in number_properties.xml.
+
index 7368411..cb49a0a 100644 (file)
@@ -1020,7 +1020,7 @@ public class HTMLDocbookTagConverter extends DocbookTagConverter implements Temp
         String type = attributes.get("type");
         String id;
         if (type != null && type.equals("scilab")) {
-            if (this.type == GenerationType.JAVAHELP) {
+            if (this.type == GenerationType.JAVAHELP || this.type == GenerationType.HTML) {
                 id = resolvScilabLink(link);
             } else {
                 return contents;
@@ -1032,9 +1032,21 @@ public class HTMLDocbookTagConverter extends DocbookTagConverter implements Temp
         }
 
         if (id == null) {
-            warnings++;
-            System.err.println("Warning (should be fixed): invalid internal link to " + link + " in " + currentFileName + "\nat line " + locator.getLineNumber());
-            return null;
+            if (isToolbox) {
+                if (this.type == GenerationType.HTML) {
+                    id = urlBase + link;
+                    if (linkToTheWeb) {
+                        id += ".html";
+                    }
+                }
+                if (this.type == GenerationType.JAVAHELP) {
+                    id = urlBase + link;
+                }
+            } else {
+                warnings++;
+                System.err.println("Warning (should be fixed): invalid internal link to " + link + " in " + currentFileName + "\nat line " + locator.getLineNumber());
+                return null;
+            }
         }
 
         Stack<DocbookElement> stack = getStack();
@@ -1082,6 +1094,7 @@ public class HTMLDocbookTagConverter extends DocbookTagConverter implements Temp
         if (pos == -1) {
             return null;
         }
+
         String first = link.substring(0, pos);
         String second = link.substring(pos + 1);
         String[] toks = first.split("\\.");