From: PJ Fanning Date: Fri, 22 Mar 2019 13:38:05 +0000 (+0000) Subject: [github-142] issue in ExcelComparator example. Thanks to chirkovmail. This close... X-Git-Tag: REL_4_1_0~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=905c53794c01cf28b801c1349046b433e3ead247;p=poi.git [github-142] issue in ExcelComparator example. Thanks to chirkovmail. This close #142 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1856053 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java b/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java index cf68cc03ec..b4108d75be 100644 --- a/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java +++ b/src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java @@ -144,8 +144,8 @@ public class ExcelComparator { } private void compareDataInSheet(Locator loc1, Locator loc2) { - for (int j = 0; j < loc1.sheet.getPhysicalNumberOfRows(); j++) { - if (loc2.sheet.getPhysicalNumberOfRows() <= j) return; + for (int j = 0; j < loc1.sheet.getLastRowNum(); j++) { + if (loc2.sheet.getLastRowNum() <= j) return; loc1.row = loc1.sheet.getRow(j); loc2.row = loc2.sheet.getRow(j); @@ -160,7 +160,7 @@ public class ExcelComparator { private void compareDataInRow(Locator loc1, Locator loc2) { for (int k = 0; k < loc1.row.getLastCellNum(); k++) { - if (loc2.row.getPhysicalNumberOfCells() <= k) return; + if (loc2.row.getLastCellNum() <= k) return; loc1.cell = loc1.row.getCell(k); loc2.cell = loc2.row.getCell(k);