Explorar o código

eclipse plugin: Fix pointing to different files

Samuel Thibault %!s(int64=4) %!d(string=hai) anos
pai
achega
c86d4ec7be
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      eclipse-plugin/src/starpu/handlers/SvgHandler.java

+ 4 - 4
eclipse-plugin/src/starpu/handlers/SvgHandler.java

@@ -54,10 +54,10 @@ public class SvgHandler extends AbstractHandler {
 				else
 				{
 					String map = TraceUtils.readFileToString(workDir + "/output.map");
-					Pattern p = Pattern.compile("href=\"[^#\"]+#");
-					IPath ipath = ((IPathEditorInput) input).getPath().makeAbsolute();
-					String chemin = ipath.toString();
-					String replaceBy = "href=\"" + chemin + "#";
+					Pattern p = Pattern.compile("href=\"([^#\"/]+/)*");
+					IPath ipath = ((IPathEditorInput) input).getPath().makeAbsolute().removeLastSegments(1);
+					String path = ipath.toString();
+					String replaceBy = "href=\"" + path + "/";
 					map = p.matcher(map).replaceAll(replaceBy);
 
 					PrintWriter pw = new PrintWriter(workDir + "/output.html");