From 5868b3f7f181a9922deb2c605ab9ce216fbc2fc8 Mon Sep 17 00:00:00 2001 From: "Andrew C. Oliver" Date: Fri, 2 Mar 2007 03:48:55 +0000 Subject: [PATCH] fix amateur hour coding mistake git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@513609 13f79535-47bb-0310-9956-ffa450edef68 --- .../hssf/record/aggregates/ValueRecordsAggregate.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java b/src/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java index b5525987b..80b932c51 100644 --- a/src/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java +++ b/src/java/org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.java @@ -214,9 +214,9 @@ public class ValueRecordsAggregate /** Returns true if the row has cells attached to it */ public boolean rowHasCells(int row) { - if (row > records.length) - return false; - CellValueRecordInterface[] rowCells=records[row]; + if (row > records.length-1) //previously this said row > records.length which means if + return false; // if records.length == 60 and I pass "60" here I get array out of bounds + CellValueRecordInterface[] rowCells=records[row]; //because a 60 length array has the last index = 59 if(rowCells==null) return false; for(int col=0;col