You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ma...@apache.org on 2010/07/09 15:30:43 UTC

svn commit: r962520 - /poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java

Author: maxcom
Date: Fri Jul  9 13:30:43 2010
New Revision: 962520

URL: http://svn.apache.org/viewvc?rev=962520&view=rev
Log:
hwpf: Range.findRange fix for out-of-range searches

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

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java?rev=962520&r1=962519&r2=962520&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/usermodel/Range.java Fri Jul  9 13:30:43 2010
@@ -962,11 +962,16 @@ public class Range { // TODO -instantiab
 	private int[] findRange(List rpl, int min, int start, int end) {
 		int x = min;
 		PropertyNode node = (PropertyNode) rpl.get(x);
+
 		while (node.getEnd() <= start && x < rpl.size() - 1) {
 			x++;
 			node = (PropertyNode) rpl.get(x);
 		}
 
+        if (node.getStart()>end) {
+            return new int[] {0, 0};
+        }
+
 		if (node.getEnd() <= start) {
 			return new int[] { rpl.size(), rpl.size() };
 		}



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