Beispiel #1
0
 /**
  * This formula was copied from a formula already present in the writable
  * workbook.  Requires special handling to sort out the cell references
  *
  * @param ws the workbook settings
  * @param es the external sheet
  * @param nt the name table
  */
 private void initializeCopiedFormula(WorkbookSettings ws,
                                      ExternalSheet es, WorkbookMethods nt)
 {
     try
     {
         parser = new FormulaParser(formulaBytes, this, es, nt, ws);
         parser.parse();
         parser.adjustRelativeCellReferences
             (getColumn() - copiedFrom.getColumn(),
             getRow() - copiedFrom.getRow());
         formulaString = parser.getFormula();
         formulaBytes  = parser.getBytes();
     }
     catch (FormulaException e)
     {
         try
         {
             // try again, with an error formula
             formulaToParse = "ERROR(1)";
             parser         = new FormulaParser(formulaToParse, es, nt, ws);
             parser.parse();
             formulaString = parser.getFormula();
             formulaBytes  = parser.getBytes();
         }
         catch (FormulaException e2)
         {
             // fail silently
             //logger.error(string.Empty, e2);
         }
     }
 }