From: Nick Burch Date: Tue, 19 Oct 2010 16:05:16 +0000 (+0000) Subject: Add a couple of methods to help make debugging problems in hwpf easier X-Git-Tag: REL_3_8_BETA1~154 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dc45d4ce75c398083531e075eed2df220528d1ed;p=poi.git Add a couple of methods to help make debugging problems in hwpf easier git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1024302 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java index ccd5f81c2e..3b3898e6fc 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java @@ -608,5 +608,8 @@ public final class CharacterRun return _props.getBrc(); } - + public String toString() { + String text = text(); + return "CharacterRun of " + text.length() + " characters - " + text; + } } diff --git a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java index 481bd556e1..230bc57919 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java @@ -154,6 +154,14 @@ public final class Picture out.write(_dataStream, pictureBytesStartOffset, size); } } + + /** + * @return The offset of this picture in the picture bytes, used + * when matching up with {@link CharacterRun#getPicOffset()} + */ + public int getStartOffset() { + return dataBlockStartOfsset; + } /** * @return picture's content as byte array