From 3f3e519628dd5e3fa915f252f283fef58b19443e Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Wed, 25 Nov 2015 11:48:17 +0000 Subject: [PATCH] bug 58651: replace for-looped sheet.getMergedRegion(index) with sheet.getMergedRegions() git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1716362 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/ss/util/SheetUtil.java | 6 ++---- .../src/org/apache/poi/hssf/converter/ExcelToHtmlUtils.java | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/java/org/apache/poi/ss/util/SheetUtil.java b/src/java/org/apache/poi/ss/util/SheetUtil.java index 31d470043d..9a258d35bf 100644 --- a/src/java/org/apache/poi/ss/util/SheetUtil.java +++ b/src/java/org/apache/poi/ss/util/SheetUtil.java @@ -104,8 +104,7 @@ public class SheetUtil { int column = cell.getColumnIndex(); int colspan = 1; - for (int i = 0 ; i < sheet.getNumMergedRegions(); i++) { - CellRangeAddress region = sheet.getMergedRegion(i); + for (CellRangeAddress region : sheet.getMergedRegions()) { if (containsCell(region, row.getRowNum(), column)) { if (!useMergedCells) { // If we're not using merged cells, skip this one and move on to the next. @@ -335,8 +334,7 @@ public class SheetUtil { } } - for (int mr=0; mr