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 178ba47f11
commit f9b0478fa4
1 changed files with 13 additions and 0 deletions

View File

@ -63,8 +63,11 @@ import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import org.apache.poi.poifs.common.POIFSConstants;
import org.apache.poi.hwpf.model.io.*; import org.apache.poi.hwpf.model.io.*;
public class TextPieceTable public class TextPieceTable
{ {
ArrayList _textPieces = new ArrayList(); ArrayList _textPieces = new ArrayList();
@ -155,6 +158,16 @@ public class TextPieceTable
TextPiece next = (TextPiece)_textPieces.get(x); TextPiece next = (TextPiece)_textPieces.get(x);
PieceDescriptor pd = next.getPieceDescriptor(); 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. // set the text piece position to the current docStream offset.
pd.setFilePosition(docStream.getOffset()); pd.setFilePosition(docStream.getOffset());