Exemplo n.º 1
0
        /**
         * Called when a column is inserted on the specified sheet.  Notifies all
         * RCIR cells of this change. The default implementation here does nothing
         *
         * @param s the sheet on which the column was inserted
         * @param sheetIndex the sheet index on which the column was inserted
         * @param col the column number which was inserted
         */
        public override void columnInserted(Sheet s, int sheetIndex, int col)
        {
            try
            {
                if (parser == null)
                {
                    byte[] formulaData  = formula.getFormulaData();
                    byte[] formulaBytes = new byte[formulaData.Length - 16];
                    System.Array.Copy(formulaData, 16,
                                      formulaBytes, 0, formulaBytes.Length);
                    parser = new FormulaParser(formulaBytes,
                                               this,
                                               getSheet().getWorkbook(),
                                               getSheet().getWorkbook(),
                                               getSheet().getWorkbookSettings());
                    parser.parse();
                }

                parser.columnInserted(sheetIndex, col, s == getSheet());
            }
            catch (FormulaException e)
            {
                //logger.warn("cannot insert column within formula:  " + e.Message);
            }
        }
Exemplo n.º 2
0
        /**
         * Inserts a column
         *
         * @param col the column to insert
         */
        public void insertColumn(int col)
        {
            if (formula1 != null)
            {
                formula1.columnInserted(0, col, true);
            }

            if (formula2 != null)
            {
                formula2.columnInserted(0, col, true);
            }

            if (column1 >= col)
            {
                column1++;
            }

            if (column2 >= col && column2 != MAX_COLUMNS)
            {
                column2++;
            }
        }
Exemplo n.º 3
0
 /**
  * Called when a column is inserted on the specified sheet.  Notifies all
  * RCIR cells of this change. The default implementation here does nothing
  *
  * @param s the sheet on which the column was inserted
  * @param sheetIndex the sheet index on which the column was inserted
  * @param col the column number which was inserted
  */
 public override void columnInserted(Sheet s, int sheetIndex, int col)
 {
     parser.columnInserted(sheetIndex, col, s == getSheet());
     formulaBytes = parser.getBytes();
 }