aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlen Stampoultzis <glens@apache.org>2002-04-08 14:03:37 +0000
committerGlen Stampoultzis <glens@apache.org>2002-04-08 14:03:37 +0000
commit8bf48bd37f57340030ac4dce1ce301617f38870c (patch)
treeb93d8a87f798d772c938a060e7f8062940192dfa
parent6e5c586edc63c7e58f09bbc965d044928f19f5ca (diff)
downloadpoi-8bf48bd37f57340030ac4dce1ce301617f38870c.tar.gz
poi-8bf48bd37f57340030ac4dce1ce301617f38870c.zip
findFirstRow fix... sheesh...
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352362 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFRow.java17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
index 6f5b0cc6b4..0bb7128eb4 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
@@ -214,7 +214,8 @@ public class HSSFRow
if (cell.getCellNum() == row.getLastCol())
{
row.setLastCol( findLastCell(row.getLastCol()) );
- } else if (cell.getCellNum() == row.getFirstCol())
+ }
+ if (cell.getCellNum() == row.getFirstCol())
{
row.setFirstCol( findFirstCell(row.getFirstCol()) );
}
@@ -330,16 +331,6 @@ public class HSSFRow
return row.getLastCol();
}
- /**
- * gets a list of cells in the row.
- * @retun List - shallow copy of cells - best you don't modify them
- */
-
-// public List getCells()
-// { // shallow copy, modifying cells changes things
- // modifying the array changes nothing!
-// return ( ArrayList ) cells.clone();
-// }
/**
* gets the number of defined cells (NOT number of cells in the actual row!).
@@ -440,10 +431,12 @@ public class HSSFRow
short cellnum = (short) (firstcell + 1);
HSSFCell r = getCell(cellnum);
- while (r == null)
+ while (r == null && cellnum <= getLastCellNum())
{
r = getCell(++cellnum);
}
+ if (cellnum > getLastCellNum())
+ return -1;
return cellnum;
}