You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ni...@apache.org on 2010/10/19 18:05:16 UTC

svn commit: r1024302 - in /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel: CharacterRun.java Picture.java

Author: nick
Date: Tue Oct 19 16:05:16 2010
New Revision: 1024302

URL: http://svn.apache.org/viewvc?rev=1024302&view=rev
Log:
Add a couple of methods to help make debugging problems in hwpf easier

Modified:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java?rev=1024302&r1=1024301&r2=1024302&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/CharacterRun.java Tue Oct 19 16:05:16 2010
@@ -608,5 +608,8 @@ public final class CharacterRun
     return _props.getBrc();
   }
 
-
+  public String toString() {
+     String text = text();
+     return "CharacterRun of " + text.length() + " characters - " + text; 
+  }
 }

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java?rev=1024302&r1=1024301&r2=1024302&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Picture.java Tue Oct 19 16:05:16 2010
@@ -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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org