vmote 2003/06/30 13:42:20 Modified: src/java/org/apache/fop/rtf/rtflib/rtfdoc RtfBookmark.java RtfHyperLink.java Log: Refactor constants to conform to style guidelines. Revision Changes Path 1.6 +7 -6 xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmark.java Index: RtfBookmark.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmark.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- RtfBookmark.java 30 Jun 2003 06:10:05 -0000 1.5 +++ RtfBookmark.java 30 Jun 2003 20:42:20 -0000 1.6 @@ -75,9 +75,9 @@ /** Name of the bokkmark */ private String bookmark = null; /** Word 2000 supports a length of 40 characters only */ - public static int maxBookmarkLength = 40; + public static final int MAX_BOOKMARK_LENGTH = 40; /** Word 2000 converts '.' in bookmarks to "_", thats why we control this replacement. */ - public static char replaceCharacter = '_'; + public static final char REPLACE_CHARACTER = '_'; ////////////////////////////////////////////////// @@ -96,9 +96,10 @@ int now = bookmark.length (); - this.bookmark = bookmark.substring (0, now < maxBookmarkLength ? now : maxBookmarkLength); - this.bookmark = this.bookmark.replace ('.', replaceCharacter); - this.bookmark = this.bookmark.replace (' ', replaceCharacter); + this.bookmark = bookmark.substring (0, + now < MAX_BOOKMARK_LENGTH ? now : MAX_BOOKMARK_LENGTH); + this.bookmark = this.bookmark.replace ('.', REPLACE_CHARACTER); + this.bookmark = this.bookmark.replace (' ', REPLACE_CHARACTER); } 1.5 +4 -4 xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHyperLink.java Index: RtfHyperLink.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHyperLink.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- RtfHyperLink.java 30 Jun 2003 06:10:05 -0000 1.4 +++ RtfHyperLink.java 30 Jun 2003 20:42:20 -0000 1.5 @@ -212,10 +212,10 @@ */ public void setInternalURL (String jumpTo) { int now = jumpTo.length (); - int max = RtfBookmark.maxBookmarkLength; + int max = RtfBookmark.MAX_BOOKMARK_LENGTH; this.url = "#" + jumpTo.substring (0, now > max ? max : now); - this.url = this.url.replace ('.', RtfBookmark.replaceCharacter); - this.url = this.url.replace (' ', RtfBookmark.replaceCharacter); + this.url = this.url.replace ('.', RtfBookmark.REPLACE_CHARACTER); + this.url = this.url.replace (' ', RtfBookmark.REPLACE_CHARACTER); } public boolean isEmpty () {
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]