]> source.dussan.org Git - poi.git/commitdiff
[github-142] issue in ExcelComparator example. Thanks to chirkovmail. This close...
authorPJ Fanning <fanningpj@apache.org>
Fri, 22 Mar 2019 13:38:05 +0000 (13:38 +0000)
committerPJ Fanning <fanningpj@apache.org>
Fri, 22 Mar 2019 13:38:05 +0000 (13:38 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1856053 13f79535-47bb-0310-9956-ffa450edef68

src/examples/src/org/apache/poi/ss/examples/ExcelComparator.java

index cf68cc03ec4a478c3778885200fc48690fd003c1..b4108d75be27c87bbd44e95cd4af701a0642ea71 100644 (file)
@@ -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);