[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Wed Jan 30 21:33:28 UTC 2008


gordonp
Wed Jan 30 16:33:28 EST 2008
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util
In directory dev.open-bio.org:/tmp/cvs-serv13756/src/main/ca/ucalgary/seahawk/util

Modified Files:
	HTMLUtils.java 
Log Message:
Made tolltip wrapping for very long words more robust
moby-live/Java/src/main/ca/ucalgary/seahawk/util HTMLUtils.java,1.6,1.7
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/HTMLUtils.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/HTMLUtils.java	2007/12/07 20:29:51	1.6
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/util/HTMLUtils.java	2008/01/30 21:33:28	1.7
@@ -144,6 +144,12 @@
 	for(String word: tokens){
 	    while(word.length()+1 > maxLineLength){  //single word is bigger than preset width, hyphenate
 		int cutPoint = maxLineLength - lineCharCount - 1;
+		if(cutPoint < word.length()-1){
+		    cutPoint = word.length()-1;
+		}
+		if(cutPoint < 0){
+		    break;
+		}
 		result.append(word.substring(0, cutPoint)+"-<br>");
 		lineCharCount = 0;
 		word = word.substring(cutPoint);




More information about the MOBY-guts mailing list