fixed a problem with unicode and text

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353450 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Said Ryan Ackley 2003-11-13 13:44:26 +00:00
parent 86f82756fe
commit ec8ef4f97c

View File

@ -63,8 +63,11 @@ import java.io.IOException;
import java.util.List;
import java.util.ArrayList;
import org.apache.poi.poifs.common.POIFSConstants;
import org.apache.poi.hwpf.model.io.*;
public class TextPieceTable
{
ArrayList _textPieces = new ArrayList();
@ -155,6 +158,16 @@ public class TextPieceTable
TextPiece next = (TextPiece)_textPieces.get(x);
PieceDescriptor pd = next.getPieceDescriptor();
int offset = docStream.getOffset();
int mod = (offset % POIFSConstants.BIG_BLOCK_SIZE);
if (mod != 0)
{
mod = POIFSConstants.BIG_BLOCK_SIZE - mod;
byte[] buf = new byte[mod];
docStream.write(buf);
}
// set the text piece position to the current docStream offset.
pd.setFilePosition(docStream.getOffset());