mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
优化合并单元格读取
This commit is contained in:
@@ -479,10 +479,7 @@ public class CellUtil {
|
||||
* @since 5.4.5
|
||||
*/
|
||||
private static Cell getCellIfMergedRegion(Sheet sheet, int x, int y) {
|
||||
final int sheetMergeCount = sheet.getNumMergedRegions();
|
||||
CellRangeAddress ca;
|
||||
for (int i = 0; i < sheetMergeCount; i++) {
|
||||
ca = sheet.getMergedRegion(i);
|
||||
for (final CellRangeAddress ca : sheet.getMergedRegions()) {
|
||||
if (ca.isInRange(y, x)) {
|
||||
return SheetUtil.getCell(sheet, ca.getFirstRow(), ca.getFirstColumn());
|
||||
}
|
||||
|
Reference in New Issue
Block a user