diff options
author | David Schweinsberg <[email protected]> | 2007-02-08 04:31:31 +0000 |
---|---|---|
committer | David Schweinsberg <[email protected]> | 2007-02-08 04:31:31 +0000 |
commit | f1870629e91802d85e69cb0c77a6331253b6b35b (patch) | |
tree | 8ba8e13af86d8d31635c9a76280c1e55a48305c8 | |
parent | d82d5bc9e90ac2f567049fc6ec5f630ade79ca23 (diff) |
Included a check in the "toString" method that a horiz and vert axis actually exist before trying to dump it.
-rw-r--r-- | src/net/java/dev/typecast/ot/table/BaseTable.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/net/java/dev/typecast/ot/table/BaseTable.java b/src/net/java/dev/typecast/ot/table/BaseTable.java index 0d022d1..7e6c37a 100644 --- a/src/net/java/dev/typecast/ot/table/BaseTable.java +++ b/src/net/java/dev/typecast/ot/table/BaseTable.java @@ -1,5 +1,5 @@ /* - * $Id: BaseTable.java,v 1.2 2007-02-05 12:41:06 davidsch Exp $ + * $Id: BaseTable.java,v 1.3 2007-02-08 04:31:31 davidsch Exp $ * * Typecast - The Font Development Environment * @@ -28,7 +28,7 @@ import net.java.dev.typecast.ot.Fixed; /** * Baseline Table - * @version $Id: BaseTable.java,v 1.2 2007-02-05 12:41:06 davidsch Exp $ + * @version $Id: BaseTable.java,v 1.3 2007-02-08 04:31:31 davidsch Exp $ * @author <a href="mailto:[email protected]">David Schweinsberg</a> */ public class BaseTable implements Table { @@ -409,15 +409,19 @@ public class BaseTable implements Table { } public String toString() { - return new StringBuffer() + StringBuffer sb = new StringBuffer() .append("; 'BASE' Table - Baseline\n;-------------------------------------\n\n") .append("BASEHeader BASEHeaderT").append(Integer.toHexString(0)) .append("\n").append(Integer.toHexString(_version)) .append("\nAxisT").append(Integer.toHexString(_horizAxisOffset)) - .append("\nAxisT").append(Integer.toHexString(_vertAxisOffset)) - .append("\n").append(_horizAxis.toString()) - .append("\n").append(_vertAxis.toString()) - .toString(); + .append("\nAxisT").append(Integer.toHexString(_vertAxisOffset)); + if (_horizAxis != null) { + sb.append("\n").append(_horizAxis.toString()); + } + if (_vertAxis != null) { + sb.append("\n").append(_vertAxis.toString()); + } + return sb.toString(); } /** |