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 e131e7d03..1a322d293 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