mirror of https://github.com/apache/poi.git
latest updates
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353175 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5fb4e2934c
commit
f635ecb606
|
@ -145,7 +145,7 @@ public class CHPFormattedDiskPage extends FormattedDiskPage
|
|||
{
|
||||
byte[] buf = new byte[512];
|
||||
int size = _chpxList.size();
|
||||
int grpprlOffset = 0;
|
||||
int grpprlOffset = 511;
|
||||
int offsetOffset = 0;
|
||||
int fcOffset = 0;
|
||||
|
||||
|
@ -185,7 +185,7 @@ public class CHPFormattedDiskPage extends FormattedDiskPage
|
|||
buf[511] = (byte)index;
|
||||
|
||||
offsetOffset = (FC_SIZE * index) + FC_SIZE;
|
||||
grpprlOffset = offsetOffset + index + (grpprlOffset % 2);
|
||||
//grpprlOffset = offsetOffset + index + (grpprlOffset % 2);
|
||||
|
||||
CHPX chpx = null;
|
||||
for (int x = 0; x < index; x++)
|
||||
|
@ -194,10 +194,13 @@ public class CHPFormattedDiskPage extends FormattedDiskPage
|
|||
byte[] grpprl = chpx.getGrpprl();
|
||||
|
||||
LittleEndian.putInt(buf, fcOffset, chpx.getStart() + fcMin);
|
||||
grpprlOffset -= (1 + grpprl.length);
|
||||
grpprlOffset -= (grpprlOffset % 2);
|
||||
buf[offsetOffset] = (byte)(grpprlOffset/2);
|
||||
System.arraycopy(grpprl, 0, buf, grpprlOffset, grpprl.length);
|
||||
buf[grpprlOffset] = (byte)grpprl.length;
|
||||
System.arraycopy(grpprl, 0, buf, grpprlOffset + 1, grpprl.length);
|
||||
|
||||
|
||||
grpprlOffset += grpprl.length + (grpprl.length % 2);
|
||||
offsetOffset += 1;
|
||||
fcOffset += FC_SIZE;
|
||||
}
|
||||
|
|
|
@ -194,7 +194,7 @@ public class PAPFormattedDiskPage extends FormattedDiskPage
|
|||
buf[511] = (byte)index;
|
||||
|
||||
bxOffset = (FC_SIZE * index) + FC_SIZE;
|
||||
grpprlOffset = bxOffset + (BX_SIZE * index) + (grpprlOffset % 2);
|
||||
grpprlOffset = 511;
|
||||
|
||||
PAPX papx = null;
|
||||
for (int x = 0; x < index; x++)
|
||||
|
@ -203,6 +203,7 @@ public class PAPFormattedDiskPage extends FormattedDiskPage
|
|||
byte[] phe = papx.getParagraphHeight().toByteArray();
|
||||
byte[] grpprl = papx.getGrpprl();
|
||||
|
||||
grpprlOffset -= (grpprl.length + (2 - grpprl.length % 2));
|
||||
LittleEndian.putInt(buf, fcOffset, papx.getStart() + fcMin);
|
||||
buf[bxOffset] = (byte)(grpprlOffset/2);
|
||||
System.arraycopy(phe, 0, buf, bxOffset + 1, phe.length);
|
||||
|
@ -210,16 +211,17 @@ public class PAPFormattedDiskPage extends FormattedDiskPage
|
|||
// refer to the section on PAPX in the spec. Places a size on the front
|
||||
// of the PAPX. Has to do with how the grpprl stays on word
|
||||
// boundaries.
|
||||
int copyOffset = grpprlOffset;
|
||||
if ((grpprl.length % 2) > 0)
|
||||
{
|
||||
buf[grpprlOffset++] = (byte)((grpprl.length + 1)/2);
|
||||
buf[copyOffset++] = (byte)((grpprl.length + 1)/2);
|
||||
}
|
||||
else
|
||||
{
|
||||
buf[++grpprlOffset] = (byte)((grpprl.length)/2);
|
||||
grpprlOffset++;
|
||||
buf[++copyOffset] = (byte)((grpprl.length)/2);
|
||||
copyOffset++;
|
||||
}
|
||||
System.arraycopy(grpprl, 0, buf, grpprlOffset, grpprl.length);
|
||||
System.arraycopy(grpprl, 0, buf, copyOffset, grpprl.length);
|
||||
|
||||
bxOffset += BX_SIZE;
|
||||
fcOffset += FC_SIZE;
|
||||
|
|
|
@ -99,6 +99,28 @@ public class PropertyNode implements Comparable
|
|||
{
|
||||
return _buf;
|
||||
}
|
||||
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
if (((PropertyNode)o).getStart() == _cpStart &&
|
||||
((PropertyNode)o).getEnd() == _cpEnd)
|
||||
{
|
||||
byte[] testBuf = ((PropertyNode)o).getBuf();
|
||||
|
||||
if (testBuf.length == _buf.length)
|
||||
{
|
||||
for (int x = 0; x < _buf.length; x++)
|
||||
{
|
||||
if (testBuf[x] != _buf[x])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Used for sorting in collections.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue