Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-1209

error message inserting math operators after parenthesis

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Normal
    • 3.9.1
    • 3.8.2
    • None
    • Security Level: Jimmy
    • None
    • Sprint 4, Sprint 6

    Description

      scenario: insert a cell in a formula enclosed in parenthesis clicking on the cells (single or multiple cells no matter).
      As soon as the parenthesis is closed, an operator is inserted and another cell is clicked to be inserted in the formula, an error message pops up:

      "This formula contains an error : The specified formula '(B2)-' contains an error. Expects cell reference or constant literal."

      Then after clicking ok, error message disappear and formula is accepted and working

      This does NOT happen if cell reference in the first part of the formula is inserted by hand, eg:

      case A)
      values in B2 and B3:
      go to C3, insert "=(", click on B2, insert ")-", click on B3 => ERROR POPS UP, click ok, formula is correct and working =(B2)-B3

      case B)
      values in B2 and B3:
      go to C3, insert "=(", insert "B2, insert ")-", click on B3 => NO ERRORS and formula is working

      no matter if using single or multiple references, eg. the same happens if the formula is:
      =sum(b2:b5)-b6

      if (b2:b5) is written by hand, no errors, if it is the result of a point-and-click with the mouse, then the error raise

      No matter which operator is used (+, -, *, /)

      steps to reproduce

      1. load a blank sheet
      2. in A1, enter =sum(
      3. click B1, the formula becomes =sum(B1
      4. enter )+
      5. click B2

      actual result

      org.zkoss.poi.ss.formula.FormulaParseException: The specified formula 'sum(A9)+' contains an error. Expects cell reference or constant literal.
      at org.zkoss.poi.ss.formula.FormulaParser.expected(FormulaParser.java:1978)
      at org.zkoss.poi.ss.formula.FormulaParser.parseSimpleFactor(FormulaParser.java:1512)
      at org.zkoss.poi.ss.formula.FormulaParser.percentFactor(FormulaParser.java:1467)
      at org.zkoss.poi.ss.formula.FormulaParser.powerFactor(FormulaParser.java:1454)
      at org.zkoss.poi.ss.formula.FormulaParser.Term(FormulaParser.java:1809)
      at org.zkoss.poi.ss.formula.FormulaParser.additiveExpression(FormulaParser.java:1925)
      at org.zkoss.poi.ss.formula.FormulaParser.concatExpression(FormulaParser.java:1893)
      at org.zkoss.poi.ss.formula.FormulaParser.comparisonExpression(FormulaParser.java:1850)
      at org.zkoss.poi.ss.formula.FormulaParser.unionExpression(FormulaParser.java:1830)
      at org.zkoss.poi.ss.formula.FormulaParser.parse(FormulaParser.java:1951)
      at org.zkoss.poi.ss.formula.FormulaParser.parse(FormulaParser.java:299)
      at org.zkoss.zssex.formula.FormulaEngineEx.parse(FormulaEngineEx.java:81)
      at org.zkoss.zss.model.impl.sys.formula.FormulaEngineImpl.parse0(FormulaEngineImpl.java:204)
      at org.zkoss.zss.model.impl.sys.formula.FormulaEngineImpl.parse(FormulaEngineImpl.java:177)
      at org.zkoss.zss.model.impl.CellImpl.setFormulaValue(CellImpl.java:265)
      at org.zkoss.zss.model.impl.CellProxy.setFormulaValue(CellProxy.java:123)
      at org.zkoss.zss.range.impl.RangeImpl$6.visit(RangeImpl.java:492)
      at org.zkoss.zss.range.impl.RangeImpl.travelCells(RangeImpl.java:257)
      at org.zkoss.zss.range.impl.RangeImpl.access$000(RangeImpl.java:104)
      at org.zkoss.zss.range.impl.RangeImpl$CellVisitorTask.invoke(RangeImpl.java:171)
      at org.zkoss.zss.model.util.ReadWriteTask.doInWriteLock(ReadWriteTask.java:43)
      at org.zkoss.zss.range.impl.RangeImpl.setEditText(RangeImpl.java:531)
      at org.zkoss.zss.api.impl.RangeImpl.setCellEditText(RangeImpl.java:553)
      at org.zkoss.zss.ui.impl.undo.CellEditTextAction.applyAction(CellEditTextAction.java:57)
      at org.zkoss.zss.ui.impl.undo.AbstractEditTextAction.doAction(AbstractEditTextAction.java:93)
      at org.zkoss.zssex.ui.impl.UndoableActionManagerImpl.doAction(UndoableActionManagerImpl.java:50)
      at org.zkoss.zss.ui.Spreadsheet.processStopEditing0(Spreadsheet.java:5413)
      at org.zkoss.zss.ui.Spreadsheet.processStopEditing(Spreadsheet.java:5355)

      expected result

      no error message occurs.

      Attachments

        Activity

          People

            henrichen henrichen
            cyberlab cyberlab
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: