From f7a6f8320ce006a6e4bfe1bf74d4e230c156ed9e Mon Sep 17 00:00:00 2001 From: Jason Height Date: Tue, 14 Oct 2003 07:57:10 +0000 Subject: [PATCH] Fix for big strings git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353399 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hssf/record/SSTDeserializer.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/poi/hssf/record/SSTDeserializer.java b/src/java/org/apache/poi/hssf/record/SSTDeserializer.java index 55f4faf94..e7d12a93c 100644 --- a/src/java/org/apache/poi/hssf/record/SSTDeserializer.java +++ b/src/java/org/apache/poi/hssf/record/SSTDeserializer.java @@ -425,10 +425,14 @@ class SSTDeserializer int charsRead = calculateCharCount( dataLengthInBytes ); LittleEndian.putShort( unicodeStringData, (byte) 0, (short) charsRead ); arraycopy( record, 0, unicodeStringData, LittleEndianConsts.SHORT_SIZE, record.length ); - UnicodeString ucs = new UnicodeString( UnicodeString.sid, (short) unicodeStringData.length, unicodeStringData ); + UnicodeString ucs = new UnicodeString( UnicodeString.sid, (short) unicodeStringData.length, unicodeStringData, unfinishedString); - unfinishedString = unfinishedString + ucs.getString(); - setContinuationCharsRead( charsRead ); + unfinishedString = ucs.getString(); + setContinuationCharsRead( getContinuationCharsRead() + charsRead ); + if (getContinuationCharsRead() == charCount) { + Integer integer = new Integer( strings.size() ); + addToStringTable( strings, integer, ucs ); + } } private boolean stringSpansContinuation( int continuationSizeInBytes )