You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by sa...@apache.org on 2003/11/10 12:48:58 UTC

cvs commit: jakarta-poi/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes CHPFormattedDiskPage.java

sackley     2003/11/10 03:48:58

  Modified:    src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes
                        CHPFormattedDiskPage.java
  Log:
  latest changes...still not working though!
  
  Revision  Changes    Path
  1.5       +6 -5      jakarta-poi/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/CHPFormattedDiskPage.java
  
  Index: CHPFormattedDiskPage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/scratchpad/src/org/apache/poi/hwpf/model/hdftypes/CHPFormattedDiskPage.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CHPFormattedDiskPage.java	1 Jul 2003 23:57:07 -0000	1.4
  +++ CHPFormattedDiskPage.java	10 Nov 2003 11:48:58 -0000	1.5
  @@ -150,25 +150,26 @@
         int fcOffset = 0;
   
         // total size is currently the size of one FC
  -      int totalSize = FC_SIZE;
  +      int totalSize = FC_SIZE + 1;
   
         int index = 0;
         for (; index < size; index++)
         {
           int grpprlLength = ((CHPX)_chpxList.get(index)).getGrpprl().length;
   
  -        // check to see if we have enough room for an FC, a byte, and the grpprl.
  -        totalSize += (FC_SIZE + 1 + grpprlLength);
  +        // check to see if we have enough room for an FC, the grpprl offset,
  +        // the grpprl size byte and the grpprl.
  +        totalSize += (FC_SIZE + 2 + grpprlLength);
           // if size is uneven we will have to add one so the first grpprl falls
           // on a word boundary
           if (totalSize > 511 + (index % 2))
           {
  -          totalSize -= (FC_SIZE + 1 + grpprlLength);
  +          totalSize -= (FC_SIZE + 2 + grpprlLength);
             break;
           }
   
           // grpprls must fall on word boundaries
  -        if (grpprlLength % 2 > 0)
  +        if ((1 + grpprlLength) % 2 > 0)
           {
             totalSize += 1;
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-dev-help@jakarta.apache.org