ASF Bugzilla – Attachment 36539 Details for
Bug 63073
return value of addMergedRegion starting from 1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to make the return value of XSSFSheet.addMergedRegion zero-based
file_63073.txt (text/plain), 1.81 KB, created by
David Gauntt
on 2019-04-21 18:00:58 UTC
(
hide
)
Description:
Patch to make the return value of XSSFSheet.addMergedRegion zero-based
Filename:
MIME Type:
Creator:
David Gauntt
Created:
2019-04-21 18:00:58 UTC
Size:
1.81 KB
patch
obsolete
> /** > * Adds a merged region of cells (hence those cells form one). > * If validate is true, check to make sure adding the merged region to the sheet doesn't create a corrupt workbook > * If validate is false, skips the expensive merged region checks, but may produce a corrupt workbook. > * > * @param region to merge > * @param validate whether to validate merged region > * @return index of this region > * @throws IllegalArgumentException if region contains fewer than 2 cells (this check is inexpensive and is performed regardless of <tt>validate</tt>) > * @throws IllegalStateException if region intersects with a multi-cell array formula > * @throws IllegalStateException if region intersects with an existing region on this sheet > */ > private int addMergedRegion(CellRangeAddress region, boolean validate) { > if (region.getNumberOfCells() < 2) { > throw new IllegalArgumentException("Merged region " + region.formatAsString() + " must contain 2 or more cells"); > } > region.validate(SpreadsheetVersion.EXCEL2007); > > if (validate) { > // throw IllegalStateException if the argument CellRangeAddress intersects with > // a multi-cell array formula defined in this sheet > validateArrayFormulas(region); > > // Throw IllegalStateException if the argument CellRangeAddress intersects with > // a merged region already in this sheet > validateMergedRegions(region); > } > > CTMergeCells ctMergeCells = worksheet.isSetMergeCells() ? worksheet.getMergeCells() : worksheet.addNewMergeCells(); > CTMergeCell ctMergeCell = ctMergeCells.addNewMergeCell(); > ctMergeCell.setRef(region.formatAsString()); > return ctMergeCells.sizeOfMergeCellArray()-1; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 63073
: 36539