Bug 9419

Summary: [PATCH] FormulaParser fails when formula starts with an AttrPtg with isSpace()=true
Product: POI Reporter: Werner Froidevaux <wfro>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 1.5   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Patch for FormulaParser
Patch for FormulaParser
Patch for FormulaParser #2

Description Werner Froidevaux 2002-05-26 01:23:32 UTC
A cell starting with '=<blank> ...' results in a stack underflow at 
toFormulaString:

                  for (int j=0;j<numOperands;j++) {
                      operands[numOperands-j-1] = (String) stack.pop(); //TODO: 
catch stack underflow and throw parse exception. 

Excel allows to have a Ptg with index=0 of type OperationPtg (an AttrPtg which 
is a blank). These OperationPtgs do not have arguments.
Comment 1 Werner Froidevaux 2002-05-26 01:24:14 UTC
Created attachment 1946 [details]
Patch for FormulaParser
Comment 2 Andy Oliver 2002-05-26 22:11:05 UTC
again please resubmit the attachment as an actual patch and not the whole
file...thanks.
Comment 3 Werner Froidevaux 2002-05-26 22:42:05 UTC
Created attachment 1951 [details]
Patch for FormulaParser
Comment 4 Andy Oliver 2002-05-26 23:21:51 UTC
applied please cross check
Comment 5 Werner Froidevaux 2002-05-26 23:32:37 UTC
Created attachment 1953 [details]
Patch for FormulaParser #2
Comment 6 Avik Sengupta 2002-05-27 21:15:54 UTC
Last patch applied. testcases to be written