hwpf: Range.findRange fix for out-of-range searches
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@962520 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7aba97ba6e
commit
8c763967ab
@ -962,11 +962,16 @@ public class Range { // TODO -instantiable superclass
|
||||
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() };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user