BUG 37056 & BUG 37058 fixed

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@368554 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Height 2006-01-13 02:19:36 +00:00
parent 8e822e3baf
commit 7758ae37db
2 changed files with 20 additions and 1 deletions

View File

@ -228,6 +228,10 @@ public class Sheet implements Model
{
retval.printGridlines = (PrintGridlinesRecord) rec;
}
else if ( rec.getSid() == GridsetRecord.sid )
{
retval.gridset = (GridsetRecord) rec;
}
else if ( rec.getSid() == HeaderRecord.sid && bofEofNestingLevel == 1)
{
retval.header = (HeaderRecord) rec;
@ -1709,6 +1713,12 @@ public class Sheet implements Model
public boolean isGridsPrinted()
{
if (gridset == null) {
gridset = (GridsetRecord)createGridset();
//Insert the newlycreated Gridset record at the end of the record (just before the EOF)
int loc = findFirstRecordLocBySid(EOFRecord.sid);
records.add(loc, gridset);
}
return !gridset.getGridset();
}
@ -2416,8 +2426,18 @@ public class Sheet implements Model
return retval;
}
/** Returns the ProtectRecord.
* If one is not contained in the sheet, then one is created.
* @return
*/
public ProtectRecord getProtect()
{
if (protect == null) {
protect = (ProtectRecord)createProtect();
//Insert the newlycreated protect record at the end of the record (just before the EOF)
int loc = findFirstRecordLocBySid(EOFRecord.sid);
records.add(loc, protect);
}
return protect;
}

View File

@ -672,7 +672,6 @@ public class UnicodeString
}
return pos - offset;
//jmh return getRecordSize();
}