From: Javen O'Neal Date: Wed, 25 Nov 2015 11:48:17 +0000 (+0000) Subject: bug 58651: replace for-looped sheet.getMergedRegion(index) with sheet.getMergedRegions() X-Git-Tag: REL_3_14_BETA1~74 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3f3e519628dd5e3fa915f252f283fef58b19443e;p=poi.git 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 --- 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