aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorGlen Stampoultzis <glens@apache.org>2002-04-01 11:17:32 +0000
committerGlen Stampoultzis <glens@apache.org>2002-04-01 11:17:32 +0000
commit7ec2e7116ce2443c658e84b2daf9f123bfcfd782 (patch)
tree40191fd6d595043387edd585da0519471eb6a5a2 /src/java
parent78be8ece111bf01ca3864cb98d1cd25c7349ddcd (diff)
downloadpoi-7ec2e7116ce2443c658e84b2daf9f123bfcfd782.tar.gz
poi-7ec2e7116ce2443c658e84b2daf9f123bfcfd782.zip
Fix for bug 7653
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352305 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFRow.java31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
index 7d508e4343..f2595aff16 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
@@ -73,6 +73,7 @@ import java.util.Iterator;
* Only rows that have cells should be added to a Sheet.
* @version 1.0-pre
* @author Andrew C. Oliver (acoliver at apache dot org)
+ * @author Glen Stampoultzis (glens at apache.org)
*/
public class HSSFRow
@@ -83,8 +84,8 @@ public class HSSFRow
public final static int INITIAL_CAPACITY = 5;
private short rowNum;
private HashMap cells;
- private short firstcell = -1;
- private short lastcell = -1;
+// private short firstcell = -1;
+// private short lastcell = -1;
/**
* reference to low level representation
@@ -125,6 +126,8 @@ public class HSSFRow
this.sheet = sheet;
row = new RowRecord();
row.setHeight((short) 0xff);
+ row.setLastCol((short)-1);
+ row.setFirstCol((short)-1);
// row.setRowNumber(rowNum);
setRowNum(rowNum);
@@ -201,7 +204,6 @@ public class HSSFRow
* remove the HSSFCell from this row.
* @param cell to remove
*/
-
public void removeCell(HSSFCell cell)
{
CellValueRecordInterface cval = cell.getCellValueRecord();
@@ -209,12 +211,12 @@ public class HSSFRow
sheet.removeValueRecord(getRowNum(), cval);
cells.remove(new Integer(cell.getCellNum()));
- if (cell.getCellNum() == lastcell)
+ if (cell.getCellNum() == row.getLastCol())
{
- lastcell = findLastCell(lastcell);
- } else if (cell.getCellNum() == firstcell)
+ row.setLastCol( findLastCell(row.getLastCol()) );
+ } else if (cell.getCellNum() == row.getFirstCol())
{
- firstcell = findFirstCell(firstcell);
+ row.setFirstCol( findFirstCell(row.getFirstCol()) );
}
}
@@ -265,13 +267,13 @@ public class HSSFRow
private void addCell(HSSFCell cell)
{
- if (firstcell == -1)
+ if (row.getFirstCol() == -1)
{
- firstcell = cell.getCellNum();
+ row.setFirstCol( cell.getCellNum() );
}
- if (lastcell == -1)
+ if (row.getLastCol() == -1)
{
- lastcell = cell.getCellNum();
+ row.setLastCol( cell.getCellNum() );
}
cells.put(new Integer(cell.getCellNum()), cell);
@@ -315,7 +317,7 @@ public class HSSFRow
public short getFirstCellNum()
{
- return firstcell;
+ return row.getFirstCol();
}
/**
@@ -325,10 +327,7 @@ public class HSSFRow
public short getLastCellNum()
{
-
- // if (cells.size() == 0) return -1;
- // return ((HSSFCell)cells.get(cells.size()-1)).getCellNum();
- return lastcell;
+ return row.getLastCol();
}
/**