View | Details | Raw Unified | Return to bug 45919
Collapse All | Expand All

(-)HSSFWorkbook.java (-21 / +40 lines)
Line 235 Link Here
236
     * This method is invoked by all HSSFWorkbook constructors with IO access
237
     * when a new sheet must be created.
238
     * ## Override this in derived classes for custom derived sheet classes ##
239
     * Just pass on the parameters to an HSSFSheet-derived-class constructor
240
     * @param pBook - The HSSF Workbook object associated with the sheet.
241
     * @param pSheet - lowlevel Sheet object this sheet will represent
242
     * @return a new HSSFSheet
243
     */
244
    protected HSSFSheet HSSFSheetFactory (HSSFWorkbook pBook, Sheet pSheet)
245
    {
246
       return new HSSFSheet (pBook, pSheet);
247
    }
248
    
249
    
250
    /**
Line 283 Link Here
283
            _sheets.add(new HSSFSheet(this, sheet));
298
            _sheets.add(HSSFSheetFactory(this, sheet));
Line 627 Link Here
643
     * You can override this in derived classes for custom derived sheet classes,
644
     * but it's not necessary, as createSheet(String) is used.
Line 634 Link Here
634
        HSSFSheet sheet = new HSSFSheet(this);
651
      //        HSSFSheet sheet = new HSSFSheet(this);
652
      //
653
      //        _sheets.add(sheet);
654
      //        workbook.setSheetName(_sheets.size() - 1, "Sheet" + (_sheets.size() - 1));
655
      //        boolean isOnlySheet = _sheets.size() == 1;
656
      //        sheet.setSelected(isOnlySheet);
657
      //        sheet.setActive(isOnlySheet);
658
      //        return sheet;
659
             return createSheet (null);    }
Lines 636-643 Link Here
636
        _sheets.add(sheet);
637
        workbook.setSheetName(_sheets.size() - 1, "Sheet" + (_sheets.size() - 1));
638
        boolean isOnlySheet = _sheets.size() == 1;
639
        sheet.setSelected(isOnlySheet);
640
        sheet.setActive(isOnlySheet);
641
        return sheet;
642
    }
643
Line 729 Link Here
747
     * ## Override this in derived classes for custom derived sheet classes ##
Line 738 Link Here
757
Lines 741-751 Link Here
741
        if (workbook.doesContainsSheetName( sheetname, _sheets.size() ))
760
      //        if (workbook.doesContainsSheetName( sheetname, _sheets.size() ))
742
            throw new IllegalArgumentException( "The workbook already contains a sheet of this name" );
761
      //            throw new IllegalArgumentException( "The workbook already contains a sheet of this name" );
743
762
      //
744
        HSSFSheet sheet = new HSSFSheet(this);
763
      //        HSSFSheet sheet = new HSSFSheet(this);
745
764
      //
746
        _sheets.add(sheet);
765
      //        _sheets.add(sheet);
747
        workbook.setSheetName(_sheets.size() - 1, sheetname);
766
      //        workbook.setSheetName(_sheets.size() - 1, sheetname);
748
        boolean isOnlySheet = _sheets.size() == 1;
767
      //        boolean isOnlySheet = _sheets.size() == 1;
749
        sheet.setSelected(isOnlySheet);
768
      //        sheet.setSelected(isOnlySheet);
750
        sheet.setActive(isOnlySheet);
769
      //        sheet.setActive(isOnlySheet);
751
        return sheet;
770
              return new HSSFSheet(this, sheetname);

Return to bug 45919