Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.RecalcIdRecord


        InternalWorkbook iwb = TestHSSFWorkbook.getInternalWorkbook(wb);
        int countryPos = iwb.findFirstRecordLocBySid(CountryRecord.sid);
        assertTrue(countryPos != -1);
        // RecalcIdRecord is not present in new workbooks
        assertEquals(null, iwb.findFirstRecordBySid(RecalcIdRecord.sid));
        RecalcIdRecord record = iwb.getRecalcId();
        assertNotNull(record);
        assertSame(record, iwb.getRecalcId());

        assertSame(record, iwb.findFirstRecordBySid(RecalcIdRecord.sid));
        assertEquals(countryPos + 1, iwb.findFirstRecordLocBySid(RecalcIdRecord.sid));

        record.setEngineId(100);
        assertEquals(100, record.getEngineId());
        assertTrue(wb.getForceFormulaRecalculation());

        wb.setForceFormulaRecalculation(true); // resets the EngineId flag to zero
        assertEquals(0, record.getEngineId());
        assertFalse(wb.getForceFormulaRecalculation());
    }
View Full Code Here


     * Get or create RecalcIdRecord
     *
     * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#setForceFormulaRecalculation(boolean)
     */
    public RecalcIdRecord getRecalcId(){
        RecalcIdRecord record = (RecalcIdRecord)findFirstRecordBySid(RecalcIdRecord.sid);
        if(record == null){
            record = new RecalcIdRecord();
            // typically goes after the Country record
            int pos = findFirstRecordLocBySid(CountryRecord.sid);
            records.add(pos + 1, record);
        }
        return record;
View Full Code Here

     * Get or create RecalcIdRecord
     *
     * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#setForceFormulaRecalculation(boolean)
     */
    public RecalcIdRecord getRecalcId(){
        RecalcIdRecord record = (RecalcIdRecord)findFirstRecordBySid(RecalcIdRecord.sid);
        if(record == null){
            record = new RecalcIdRecord();
            // typically goes after the Country record
            int pos = findFirstRecordLocBySid(CountryRecord.sid);
            records.add(pos + 1, record);
        }
        return record;
View Full Code Here

     * workbook values when the workbook is opened
     * @since 3.8
     */
    public void setForceFormulaRecalculation(boolean value){
        InternalWorkbook iwb = getWorkbook();
        RecalcIdRecord recalc = iwb.getRecalcId();
        recalc.setEngineId(0);
    }
View Full Code Here

     *
     * @since 3.8
     */
    public boolean getForceFormulaRecalculation(){
        InternalWorkbook iwb = getWorkbook();
        RecalcIdRecord recalc = (RecalcIdRecord)iwb.findFirstRecordBySid(RecalcIdRecord.sid);
        return recalc != null && recalc.getEngineId() != 0;
    }
View Full Code Here

     * Get or create RecalcIdRecord
     *
     * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#setForceFormulaRecalculation(boolean)
     */
    public RecalcIdRecord getRecalcId(){
        RecalcIdRecord record = (RecalcIdRecord)findFirstRecordBySid(RecalcIdRecord.sid);
        if(record == null){
            record = new RecalcIdRecord();
            // typically goes after the Country record
            int pos = findFirstRecordLocBySid(CountryRecord.sid);
            records.add(pos + 1, record);
        }
        return record;
View Full Code Here

        InternalWorkbook iwb = TestHSSFWorkbook.getInternalWorkbook(wb);
        int countryPos = iwb.findFirstRecordLocBySid(CountryRecord.sid);
        assertTrue(countryPos != -1);
        // RecalcIdRecord is not present in new workbooks
        assertEquals(null, iwb.findFirstRecordBySid(RecalcIdRecord.sid));
        RecalcIdRecord record = iwb.getRecalcId();
        assertNotNull(record);
        assertSame(record, iwb.getRecalcId());

        assertSame(record, iwb.findFirstRecordBySid(RecalcIdRecord.sid));
        assertEquals(countryPos + 1, iwb.findFirstRecordLocBySid(RecalcIdRecord.sid));

        record.setEngineId(100);
        assertEquals(100, record.getEngineId());
        assertTrue(wb.getForceFormulaRecalculation());

        wb.setForceFormulaRecalculation(true); // resets the EngineId flag to zero
        assertEquals(0, record.getEngineId());
        assertFalse(wb.getForceFormulaRecalculation());
    }
View Full Code Here

     * Get or create RecalcIdRecord
     *
     * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#setForceFormulaRecalculation(boolean)
     */
    public RecalcIdRecord getRecalcId(){
        RecalcIdRecord record = (RecalcIdRecord)findFirstRecordBySid(RecalcIdRecord.sid);
        if(record == null){
            record = new RecalcIdRecord();
            // typically goes after the Country record
            int pos = findFirstRecordLocBySid(CountryRecord.sid);
            records.add(pos + 1, record);
        }
        return record;
View Full Code Here

     * workbook values when the workbook is opened
     * @since 3.8
     */
    public void setForceFormulaRecalculation(boolean value){
        InternalWorkbook iwb = getWorkbook();
        RecalcIdRecord recalc = iwb.getRecalcId();
        recalc.setEngineId(0);
    }
View Full Code Here

     *
     * @since 3.8
     */
    public boolean getForceFormulaRecalculation(){
        InternalWorkbook iwb = getWorkbook();
        RecalcIdRecord recalc = (RecalcIdRecord)iwb.findFirstRecordBySid(RecalcIdRecord.sid);
        return recalc != null && recalc.getEngineId() != 0;
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.RecalcIdRecord

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.