From: Sergey Vladimirov Date: Mon, 11 Jul 2011 18:33:32 +0000 (+0000) Subject: deprecate BytePropertyNode X-Git-Tag: REL_3_8_BETA4~217 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f62965c2a379b35b102964787c3060ea478aebf2;p=poi.git deprecate BytePropertyNode git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1145274 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java b/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java index e131e7d039..1a322d2939 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/BytePropertyNode.java @@ -33,6 +33,7 @@ public abstract class BytePropertyNode> extends /** * @param fcStart The start of the text for this property, in _bytes_ * @param fcEnd The end of the text for this property, in _bytes_ + * @deprecated */ public BytePropertyNode(int fcStart, int fcEnd, CharIndexTranslator translator, Object buf) { super( @@ -49,6 +50,18 @@ public abstract class BytePropertyNode> extends this.endBytes = fcEnd; } + public BytePropertyNode( int charStart, int charEnd, Object buf ) + { + super( charStart, charEnd, buf ); + + if ( charStart > charEnd ) + throw new IllegalArgumentException( "charStart (" + charStart + + ") > charEnd (" + charEnd + ")" ); + + this.startBytes = -1; + this.endBytes = -1; + } + /** * @deprecated Though bytes are actually stored in file, it is advised to * use char positions for all operations. Including save