From cb05f2ac5f9bc97d6336e1dd9b2b0f1dac485f5d Mon Sep 17 00:00:00 2001 From: William Victor Mote Date: Mon, 30 Jun 2003 20:42:20 +0000 Subject: [PATCH] Refactor constants to conform to style guidelines. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196550 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmark.java | 11 ++++++----- .../apache/fop/rtf/rtflib/rtfdoc/RtfHyperLink.java | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmark.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmark.java index d13129880..86d1cfd14 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmark.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfBookmark.java @@ -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); } diff --git a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHyperLink.java b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHyperLink.java index 1cbf01bbc..516892ad3 100755 --- a/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHyperLink.java +++ b/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfHyperLink.java @@ -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 () { -- 2.39.5