You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by jh...@apache.org on 2006/01/13 03:19:51 UTC

svn commit: r368554 - in /jakarta/poi/trunk/src/java/org/apache/poi/hssf: model/Sheet.java record/UnicodeString.java

Author: jheight
Date: Thu Jan 12 18:19:36 2006
New Revision: 368554

URL: http://svn.apache.org/viewcvs?rev=368554&view=rev
Log:
BUG 37056 & BUG 37058 fixed

Modified:
    jakarta/poi/trunk/src/java/org/apache/poi/hssf/model/Sheet.java
    jakarta/poi/trunk/src/java/org/apache/poi/hssf/record/UnicodeString.java

Modified: jakarta/poi/trunk/src/java/org/apache/poi/hssf/model/Sheet.java
URL: http://svn.apache.org/viewcvs/jakarta/poi/trunk/src/java/org/apache/poi/hssf/model/Sheet.java?rev=368554&r1=368553&r2=368554&view=diff
==============================================================================
--- jakarta/poi/trunk/src/java/org/apache/poi/hssf/model/Sheet.java (original)
+++ jakarta/poi/trunk/src/java/org/apache/poi/hssf/model/Sheet.java Thu Jan 12 18:19:36 2006
@@ -228,6 +228,10 @@
             {
                 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 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 @@
         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;
     }
 

Modified: jakarta/poi/trunk/src/java/org/apache/poi/hssf/record/UnicodeString.java
URL: http://svn.apache.org/viewcvs/jakarta/poi/trunk/src/java/org/apache/poi/hssf/record/UnicodeString.java?rev=368554&r1=368553&r2=368554&view=diff
==============================================================================
--- jakarta/poi/trunk/src/java/org/apache/poi/hssf/record/UnicodeString.java (original)
+++ jakarta/poi/trunk/src/java/org/apache/poi/hssf/record/UnicodeString.java Thu Jan 12 18:19:36 2006
@@ -672,7 +672,6 @@
       }
 
         return pos - offset;
-        //jmh return getRecordSize();
     }
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/