Package org.zkoss.poi.hssf.record

Examples of org.zkoss.poi.hssf.record.NameRecord


     */
    //20100705, henrichen@zkoss.org: update named references
    private void updateNamesAfterCellShift(PtgShifter shifter) {
      InternalWorkbook book = new HSSFWorkbookHelper(getWorkbook()).getInternalWorkbook();
        for (int i = 0 ; i < book.getNumNames() ; ++i){
            NameRecord nr = book.getNameRecord(i);
            Ptg[] ptgs = nr.getNameDefinition();
            if (shifter.adjustFormula(ptgs, nr.getSheetNumber())) {
                nr.setNameDefinition(ptgs);
            }
        }
    }
View Full Code Here


  public CellRangeAddress getRepeatingRowsAndColumns(int sheetIndex) {
    final int nameIndex  = findExistingBuiltinNameRecordIdx(sheetIndex, NameRecord.BUILTIN_PRINT_TITLE);
    if (nameIndex == -1) {
      return new CellRangeAddress(-1, -1, -1, -1);
    }
    final NameRecord r = getNameRecord(nameIndex);
    Ptg[] ptgs = r.getNameDefinition();
    return BookHelper.getRepeatRowsAndColumns(ptgs);
  }
View Full Code Here

  //a direct copy from HSSFWorkbook#findExistingBuiltinNameRecordIdx
    private int findExistingBuiltinNameRecordIdx(int sheetIndex, byte builtinCode) {
      final int sz = getNumberOfNames();
        for(int defNameIndex =0; defNameIndex<sz; defNameIndex++) {
            NameRecord r = _helper.getInternalWorkbook().getNameRecord(defNameIndex);
            if (r == null) {
                throw new RuntimeException("Unable to find all defined names to iterate over");
            }
            if (!r.isBuiltInName() || r.getBuiltInName() != builtinCode) {
                continue;
            }
            if (r.getSheetNumber() -1 == sheetIndex) {
                return defNameIndex;
            }
        }
        return -1;
    }
View Full Code Here

TOP

Related Classes of org.zkoss.poi.hssf.record.NameRecord

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.