jmol 12 patch - ensure we replace the correct filename in the jmol script before...
authorjprocter <Jim Procter>
Tue, 29 Jun 2010 16:24:11 +0000 (16:24 +0000)
committerjprocter <Jim Procter>
Tue, 29 Jun 2010 16:24:11 +0000 (16:24 +0000)
src/jalview/gui/Jalview2XML.java

index af8b2c0..1a6024e 100755 (executable)
@@ -2510,14 +2510,15 @@ public class Jalview2XML
                 // create a new Jmol window
                 String state = ids[p].getStructureState(s).getContent();
                 StringBuffer newFileLoc = null;
-                if (state.indexOf("load") > -1)
+                int cp=0;
+                if ((cp=state.indexOf("load ")) > -1)
                 {
-                  newFileLoc = new StringBuffer(state.substring(0, state
-                          .indexOf("\"", state.indexOf("load")) + 1));
+                  newFileLoc = new StringBuffer(state.substring(0, (cp=state
+                          .indexOf("\"", cp+1)+1)));
 
                   newFileLoc.append(jpdb.getFile());
                   newFileLoc.append(state.substring(state.indexOf("\"",
-                          state.indexOf("load \"") + 6)));
+                          cp+1)));
                 }
                 else
                 {