]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Refactor constants to conform to style guidelines.
authorWilliam Victor Mote <vmote@apache.org>
Mon, 30 Jun 2003 20:42:20 +0000 (20:42 +0000)
committerWilliam Victor Mote <vmote@apache.org>
Mon, 30 Jun 2003 20:42:20 +0000 (20:42 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196550 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmark.java
src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHyperLink.java

index d13129880caff41944eaa4b4762dfb15a6233ecf..86d1cfd14998f87337c0c4d3c0d0847f4c747432 100755 (executable)
@@ -75,9 +75,9 @@ public class RtfBookmark extends RtfElement {
     /** 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 @@ public class RtfBookmark extends RtfElement {
 
         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);
     }
 
 
index 1cbf01bbc22ace2925fb0c536a62bd569856ae1b..516892ad310862f24987d21edf7ea2dec04fb75c 100755 (executable)
@@ -212,10 +212,10 @@ public class RtfHyperLink extends RtfContainer implements IRtfTextContainer {
      */
     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 () {