Package org.apache.poi.hssf.model

Examples of org.apache.poi.hssf.model.InternalSheet$RecordCloner


        // convert all LabelRecord records to LabelSSTRecord
        convertLabelRecords(records, recOffset);
        RecordStream rs = new RecordStream(records, recOffset);
        while (rs.hasNext()) {
            InternalSheet sheet = InternalSheet.createSheet(rs);
            _sheets.add(new HSSFSheet(this, sheet));
        }

        for (int i = 0 ; i < workbook.getNumNames() ; ++i){
            NameRecord nameRecord = workbook.getNameRecord(i);
View Full Code Here


        // convert all LabelRecord records to LabelSSTRecord
        convertLabelRecords(records, recOffset);
        RecordStream rs = new RecordStream(records, recOffset);
        while (rs.hasNext()) {
            InternalSheet sheet = InternalSheet.createSheet(rs);
            _sheets.add(new HSSFSheet(this, sheet));
        }

        for (int i = 0 ; i < workbook.getNumNames() ; ++i){
            NameRecord nameRecord = workbook.getNameRecord(i);
View Full Code Here

        FormulaShifter shifter = FormulaShifter.createForRowShift(externSheetIndex, startRow, endRow, n);
        _sheet.updateFormulasAfterCellShift(shifter, externSheetIndex);

        int nSheets = _workbook.getNumberOfSheets();
        for(int i=0; i<nSheets; i++) {
            InternalSheet otherSheet = _workbook.getSheetAt(i).getSheet();
            if (otherSheet == this._sheet) {
                continue;
            }
            short otherExtSheetIx = _book.checkExternSheet(i);
            otherSheet.updateFormulasAfterCellShift(shifter, otherExtSheetIx);
        }
        _workbook.getWorkbook().updateNamesAfterCellShift(shifter);
    }
View Full Code Here

        FormulaShifter shifter = FormulaShifter.createForRowShift(externSheetIndex, startRow, endRow, n);
        _sheet.updateFormulasAfterCellShift(shifter, externSheetIndex);

        int nSheets = _workbook.getNumberOfSheets();
        for(int i=0; i<nSheets; i++) {
            InternalSheet otherSheet = _workbook.getSheetAt(i).getSheet();
            if (otherSheet == this._sheet) {
                continue;
            }
            short otherExtSheetIx = _book.checkExternSheet(i);
            otherSheet.updateFormulasAfterCellShift(shifter, otherExtSheetIx);
        }
        _workbook.getWorkbook().updateNamesAfterCellShift(shifter);
    }
View Full Code Here

        // convert all LabelRecord records to LabelSSTRecord
        convertLabelRecords(records, recOffset);
        RecordStream rs = new RecordStream(records, recOffset);
        while (rs.hasNext()) {
            InternalSheet sheet = InternalSheet.createSheet(rs);
            _sheets.add(new HSSFSheet(this, sheet));
        }

        for (int i = 0 ; i < workbook.getNumNames() ; ++i){
            NameRecord nameRecord = workbook.getNameRecord(i);
View Full Code Here

    //read in sample
    HSSFWorkbook book = HSSFTestDataSamples.openSampleWorkbook("Simple.xls");

    //check initial position
    HSSFSheet umSheet = book.getSheetAt(0);
    InternalSheet s = umSheet.getSheet();
    assertEquals("Initial active cell should be in col 0",
      (short) 0, s.getActiveCellCol());
    assertEquals("Initial active cell should be on row 1",
      1, s.getActiveCellRow());

    //modify position through HSSFCell
    HSSFCell cell = umSheet.createRow(3).createCell(2);
    cell.setAsActiveCell();
    assertEquals("After modify, active cell should be in col 2",
      (short) 2, s.getActiveCellCol());
    assertEquals("After modify, active cell should be on row 3",
      3, s.getActiveCellRow());

    //write book to temp file; read and verify that position is serialized
    book = HSSFTestDataSamples.writeOutAndReadBack(book);

    umSheet = book.getSheetAt(0);
    s = umSheet.getSheet();

    assertEquals("After serialize, active cell should be in col 2",
      (short) 2, s.getActiveCellCol());
    assertEquals("After serialize, active cell should be on row 3",
      3, s.getActiveCellRow());
  }
View Full Code Here

        // convert all LabelRecord records to LabelSSTRecord
        convertLabelRecords(records, recOffset);
        RecordStream rs = new RecordStream(records, recOffset);
        while (rs.hasNext()) {
            InternalSheet sheet = InternalSheet.createSheet(rs);
            _sheets.add(new HSSFSheet(this, sheet));
        }

        for (int i = 0 ; i < workbook.getNumNames() ; ++i){
            NameRecord nameRecord = workbook.getNameRecord(i);
View Full Code Here

        new UserSViewEnd(HexRead.readFromString("01, 00")),

        EOFRecord.instance,
    };
    RecordStream rs = new RecordStream(Arrays.asList(recs), 0);
    InternalSheet sheet;
    try {
      sheet = InternalSheet.createSheet(rs);
    } catch (RuntimeException e) {
      if (e.getMessage().equals("two Page Settings Blocks found in the same sheet")) {
        throw new AssertionFailedError("Identified bug 46480");
      }
      throw e;
    }

    RecordCollector rv = new RecordCollector();
    sheet.visitContainedRecords(rv, rowIx);
    Record[] outRecs = rv.getRecords();
    assertEquals(13, outRecs.length);
  }
View Full Code Here

        new WindowTwoRecord(),
        new HeaderFooterRecord(HexRead.readFromString("9C 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C4 60 00 00 00 00 00 00 00 00")),
        EOFRecord.instance,
    };
    RecordStream rs = new RecordStream(Arrays.asList(recs), 0);
    InternalSheet sheet = InternalSheet.createSheet(rs);

    RecordCollector rv = new RecordCollector();
    sheet.visitContainedRecords(rv, 0);
    Record[] outRecs = rv.getRecords();
    if (outRecs[4] == EOFRecord.instance) {
      throw new AssertionFailedError("Identified bug 46953 - EOF incorrectly appended to PSB");
    }
    assertEquals(recs.length+1, outRecs.length); // +1 for index record
View Full Code Here

        new WindowTwoRecord(),
        EOFRecord.instance,
    };
    RecordStream rs = new RecordStream(Arrays.asList(recs), 0);

    InternalSheet sheet;
    try {
      sheet = InternalSheet.createSheet(rs);
    } catch (RuntimeException e) {
      if (e.getMessage().equals("two Page Settings Blocks found in the same sheet")) {
        throw new AssertionFailedError("Identified bug 47199a - failed to process late margings records");
      }
      throw e;
    }

    RecordCollector rv = new RecordCollector();
    sheet.visitContainedRecords(rv, 0);
    Record[] outRecs = rv.getRecords();
    assertEquals(recs.length+1, outRecs.length); // +1 for index record

    assertEquals(BOFRecord.class, outRecs[0].getClass());
    assertEquals(IndexRecord.class, outRecs[1].getClass());
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.model.InternalSheet$RecordCloner

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.