latest update
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353185 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a3d6a57ec3
commit
f72abf8ae8
@ -94,6 +94,11 @@ public class CHPBinTable
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList getTextRuns()
|
||||
{
|
||||
return _textRuns;
|
||||
}
|
||||
|
||||
public void writeTo(HWPFFileSystem sys, int fcMin)
|
||||
throws IOException
|
||||
{
|
||||
@ -122,7 +127,6 @@ public class CHPBinTable
|
||||
|
||||
|
||||
ArrayList overflow = _textRuns;
|
||||
byte[] intHolder = new byte[4];
|
||||
do
|
||||
{
|
||||
PropertyNode startingProp = (PropertyNode)overflow.get(0);
|
||||
@ -138,9 +142,10 @@ public class CHPBinTable
|
||||
int end = endingFc;
|
||||
if (overflow != null)
|
||||
{
|
||||
end = ((PropertyNode)overflow.get(0)).getEnd();
|
||||
end = ((PropertyNode)overflow.get(0)).getStart();
|
||||
}
|
||||
|
||||
byte[] intHolder = new byte[4];
|
||||
LittleEndian.putInt(intHolder, pageNum++);
|
||||
binTable.addProperty(new PropertyNode(start, end, intHolder));
|
||||
|
||||
|
@ -178,7 +178,7 @@ public class CHPFormattedDiskPage extends FormattedDiskPage
|
||||
if (index != size)
|
||||
{
|
||||
_overFlow = new ArrayList();
|
||||
_overFlow.addAll(index, _chpxList);
|
||||
_overFlow.addAll(_chpxList.subList(index, size));
|
||||
}
|
||||
|
||||
// index should equal number of CHPXs that will be in this fkp now.
|
||||
|
@ -126,7 +126,6 @@ public class PAPBinTable
|
||||
|
||||
|
||||
ArrayList overflow = _paragraphs;
|
||||
byte[] intHolder = new byte[4];
|
||||
do
|
||||
{
|
||||
PropertyNode startingProp = (PropertyNode)overflow.get(0);
|
||||
@ -142,9 +141,10 @@ public class PAPBinTable
|
||||
int end = endingFc;
|
||||
if (overflow != null)
|
||||
{
|
||||
end = ((PropertyNode)overflow.get(0)).getEnd();
|
||||
end = ((PropertyNode)overflow.get(0)).getStart();
|
||||
}
|
||||
|
||||
byte[] intHolder = new byte[4];
|
||||
LittleEndian.putInt(intHolder, pageNum++);
|
||||
binTable.addProperty(new PropertyNode(start, end, intHolder));
|
||||
|
||||
|
@ -187,7 +187,7 @@ public class PAPFormattedDiskPage extends FormattedDiskPage
|
||||
if (index != size)
|
||||
{
|
||||
_overFlow = new ArrayList();
|
||||
_overFlow.addAll(index, _papxList);
|
||||
_overFlow.addAll(_papxList.subList(index, size));
|
||||
}
|
||||
|
||||
// index should equal number of papxs that will be in this fkp now.
|
||||
@ -234,7 +234,7 @@ public class PAPFormattedDiskPage extends FormattedDiskPage
|
||||
|
||||
private ParagraphHeight getParagraphHeight(int index)
|
||||
{
|
||||
int pheOffset = 1 + (((_crun + 1) * 4) + (index * 13));
|
||||
int pheOffset = _offset + 1 + (((_crun + 1) * 4) + (index * 13));
|
||||
|
||||
ParagraphHeight phe = new ParagraphHeight(_fkp, pheOffset);
|
||||
|
||||
|
@ -82,5 +82,13 @@ public class PAPX extends PropertyNode
|
||||
return super.getBuf();
|
||||
}
|
||||
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
if (super.equals(o))
|
||||
{
|
||||
return _phe.equals(((PAPX)o)._phe);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -105,4 +105,11 @@ public class ParagraphHeight
|
||||
return buf;
|
||||
}
|
||||
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
ParagraphHeight ph = (ParagraphHeight)o;
|
||||
|
||||
return infoField == ph.infoField && reserved == ph.reserved &&
|
||||
dxaCol == ph.dxaCol && dymLineOrHeight == ph.dymLineOrHeight;
|
||||
}
|
||||
}
|
||||
|
@ -135,4 +135,10 @@ public class PieceDescriptor
|
||||
return 8;
|
||||
}
|
||||
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
PieceDescriptor pd = (PieceDescriptor)o;
|
||||
|
||||
return descriptor == pd.descriptor && prm == pd.prm && unicode == pd.unicode;
|
||||
}
|
||||
}
|
||||
|
@ -92,4 +92,14 @@ public class TextPiece extends PropertyNode implements Comparable
|
||||
{
|
||||
return _pd;
|
||||
}
|
||||
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
if (super.equals(o))
|
||||
{
|
||||
TextPiece tp = (TextPiece)o;
|
||||
return tp._usesUnicode == _usesUnicode && _pd.equals(tp._pd);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -147,5 +147,23 @@ public class TextPieceTable
|
||||
|
||||
}
|
||||
|
||||
public boolean equals(Object o)
|
||||
{
|
||||
TextPieceTable tpt = (TextPieceTable)o;
|
||||
|
||||
int size = tpt._textPieces.size();
|
||||
if (size == _textPieces.size())
|
||||
{
|
||||
for (int x = 0; x < size; x++)
|
||||
{
|
||||
if (!tpt._textPieces.get(x).equals(_textPieces.get(x)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user