PAPXpublic class PAPX extends PropertyNode
Fields Summary |
---|
private ParagraphHeight | _phe | private int | _hugeGrpprlOffset |
Constructors Summary |
---|
public PAPX(int fcStart, int fcEnd, byte[] papx, ParagraphHeight phe, byte[] dataStream)
super(fcStart, fcEnd, new SprmBuffer(papx));
_phe = phe;
SprmBuffer buf = findHuge(new SprmBuffer(papx), dataStream);
if(buf != null)
_buf = buf;
| public PAPX(int fcStart, int fcEnd, SprmBuffer buf, byte[] dataStream)
super(fcStart, fcEnd, buf);
_phe = new ParagraphHeight();
buf = findHuge(buf, dataStream);
if(buf != null)
_buf = buf;
|
Methods Summary |
---|
public boolean | equals(java.lang.Object o)
if (super.equals(o))
{
return _phe.equals(((PAPX)o)._phe);
}
return false;
| private org.apache.poi.hwpf.sprm.SprmBuffer | findHuge(org.apache.poi.hwpf.sprm.SprmBuffer buf, byte[] datastream)
byte[] grpprl = buf.toByteArray();
if(grpprl.length==8 && datastream!=null) // then check for sprmPHugePapx
{
SprmOperation sprm = new SprmOperation(grpprl, 2);
if ((sprm.getOperation()==0x45 || sprm.getOperation()==0x46)
&& sprm.getSizeCode() == 3)
{
int hugeGrpprlOffset = sprm.getOperand();
if(hugeGrpprlOffset+1 < datastream.length)
{
int grpprlSize = LittleEndian.getShort(datastream, hugeGrpprlOffset);
if( hugeGrpprlOffset+grpprlSize < datastream.length)
{
byte[] hugeGrpprl = new byte[grpprlSize + 2];
// copy original istd into huge Grpprl
hugeGrpprl[0] = grpprl[0]; hugeGrpprl[1] = grpprl[1];
// copy Grpprl from dataStream
System.arraycopy(datastream, hugeGrpprlOffset + 2, hugeGrpprl, 2,
grpprlSize);
// save a pointer to where we got the huge Grpprl from
_hugeGrpprlOffset = hugeGrpprlOffset;
return new SprmBuffer(hugeGrpprl);
}
}
}
}
return null;
| public byte[] | getGrpprl()
return ((SprmBuffer)_buf).toByteArray();
| public int | getHugeGrpprlOffset()
return _hugeGrpprlOffset;
| public short | getIstd()
byte[] buf = getGrpprl();
if (buf.length == 0)
{
return 0;
}
else
{
return LittleEndian.getShort(buf);
}
| public org.apache.poi.hwpf.model.ParagraphHeight | getParagraphHeight()
return _phe;
| public org.apache.poi.hwpf.usermodel.ParagraphProperties | getParagraphProperties(org.apache.poi.hwpf.model.StyleSheet ss)
short istd = getIstd();
ParagraphProperties baseStyle = ss.getParagraphStyle(istd);
ParagraphProperties props = ParagraphSprmUncompressor.uncompressPAP(baseStyle, getGrpprl(), 2);
return props;
| public org.apache.poi.hwpf.sprm.SprmBuffer | getSprmBuf()
return (SprmBuffer)_buf;
|
|