diff options
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/poi/ss/formula/FormulaParser.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/java/org/apache/poi/ss/formula/FormulaParser.java b/src/java/org/apache/poi/ss/formula/FormulaParser.java index f2430a90be..8e5d8e999a 100644 --- a/src/java/org/apache/poi/ss/formula/FormulaParser.java +++ b/src/java/org/apache/poi/ss/formula/FormulaParser.java @@ -1530,11 +1530,19 @@ public final class FormulaParser { while (true) { SkipWhite(); if (_inIntersection) { + int savePointer = _pointer; + // Don't getChar() as the space has already been eaten and recorded by SkipWhite(). - hasIntersections = true; - ParseNode other = comparisonExpression(); - result = new ParseNode(IntersectionPtg.instance, result, other); - continue; + try { + ParseNode other = comparisonExpression(); + result = new ParseNode(IntersectionPtg.instance, result, other); + hasIntersections = true; + continue; + } catch (FormulaParseException e) { + // if parsing for intersection fails we assume that we actually had an arbitrary + // whitespace and thus should simply skip this whitespace + resetPointer(savePointer); + } } if (hasIntersections) { return augmentWithMemPtg(result); |