From dc45d4ce75c398083531e075eed2df220528d1ed Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Tue, 19 Oct 2010 16:05:16 +0000 Subject: [PATCH] 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 --- .../src/org/apache/poi/hwpf/usermodel/CharacterRun.java | 5 ++++- .../src/org/apache/poi/hwpf/usermodel/Picture.java | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) 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 -- 2.39.5