/** * Return the default sheet view. This is the last one if the sheet's views, according to sec. 3.3.1.83 * of the OOXML spec: "A single sheet view definition. When more than 1 sheet view is defined in the file, * it means that when opening the workbook, each sheet view corresponds to a separate window within the * spreadsheet application, where each window is showing the particular sheet. containing the same * workbookViewId value, the last sheetView definition is loaded, and the others are discarded. * When multiple windows are viewing the same sheet, multiple sheetView elements (with corresponding * workbookView entries) are saved." */ private CTSheetView getDefaultSheetView(final boolean create) { final CTSheetViews views = getSheetTypeSheetViews(create); assert(views != null || !create); if (views == null) { return null; } final int sz = views.sizeOfSheetViewArray(); assert(sz > 0 || !create); return (sz == 0) ? null : views.getSheetViewArray(sz - 1); }
protected CTSheetViews getSheetTypeSheetViews(final boolean create) { final CTSheetViews views = (worksheet.isSetSheetViews() || !create) ? worksheet.getSheetViews() : worksheet.addNewSheetViews(); assert(views != null || !create); if (views == null) { return null; } if (views.sizeOfSheetViewArray() == 0 && create) { views.addNewSheetView(); } return views; }
/** * Return the default sheet view. This is the last one if the sheet's views, according to sec. 3.3.1.83 * of the OOXML spec: "A single sheet view definition. When more than 1 sheet view is defined in the file, * it means that when opening the workbook, each sheet view corresponds to a separate window within the * spreadsheet application, where each window is showing the particular sheet. containing the same * workbookViewId value, the last sheetView definition is loaded, and the others are discarded. * When multiple windows are viewing the same sheet, multiple sheetView elements (with corresponding * workbookView entries) are saved." */ private CTSheetView getDefaultSheetView() { CTSheetViews views = getSheetTypeSheetViews(); int sz = views == null ? 0 : views.sizeOfSheetViewArray(); if (sz == 0) { return null; } return views.getSheetViewArray(sz - 1); }
/** * Return the default sheet view. This is the last one if the sheet's views, according to sec. 3.3.1.83 * of the OOXML spec: "A single sheet view definition. When more than 1 sheet view is defined in the file, * it means that when opening the workbook, each sheet view corresponds to a separate window within the * spreadsheet application, where each window is showing the particular sheet. containing the same * workbookViewId value, the last sheetView definition is loaded, and the others are discarded. * When multiple windows are viewing the same sheet, multiple sheetView elements (with corresponding * workbookView entries) are saved." */ private CTSheetView getDefaultSheetView(final boolean create) { final CTSheetViews views = getSheetTypeSheetViews(create); assert(views != null || !create); if (views == null) { return null; } final int sz = views.sizeOfSheetViewArray(); assert(sz > 0 || !create); return (sz == 0) ? null : views.getSheetViewArray(sz - 1); }
protected CTSheetViews getSheetTypeSheetViews(final boolean create) { final CTSheetViews views = (worksheet.isSetSheetViews() || !create) ? worksheet.getSheetViews() : worksheet.addNewSheetViews(); assert(views != null || !create); if (views == null) { return null; } if (views.sizeOfSheetViewArray() == 0 && create) { views.addNewSheetView(); } return views; }