Bug 9419 - [PATCH] FormulaParser fails when formula starts with an AttrPtg with isSpace()=true
Summary: [PATCH] FormulaParser fails when formula starts with an AttrPtg with isSpace(...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 1.5
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-26 01:23 UTC by Werner Froidevaux
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments
Patch for FormulaParser (14.59 KB, patch)
2002-05-26 01:24 UTC, Werner Froidevaux
Details | Diff
Patch for FormulaParser (2.32 KB, patch)
2002-05-26 22:42 UTC, Werner Froidevaux
Details | Diff
Patch for FormulaParser #2 (2.90 KB, patch)
2002-05-26 23:32 UTC, Werner Froidevaux
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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