ASF Bugzilla – Attachment 8168 Details for
Bug 23083
Creating Workbook from existing Excel file containing Rich Text will sometimes fail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
This fixes the problem.Basically, it detects when the character part of the string is complete, and stores off the bytes to skip in the next Continue block to get to the start of the next string.
patch.txt (text/plain), 1.89 KB, created by
Wayne Seguin
on 2003-09-11 19:48:45 UTC
(
hide
)
Description:
This fixes the problem.Basically, it detects when the character part of the string is complete, and stores off the bytes to skip in the next Continue block to get to the start of the next string.
Filename:
MIME Type:
Creator:
Wayne Seguin
Created:
2003-09-11 19:48:45 UTC
Size:
1.89 KB
patch
obsolete
>Index: SSTDeserializer.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/hssf/record/SSTDeserializer.java,v >retrieving revision 1.5 >diff -u -r1.5 SSTDeserializer.java >--- SSTDeserializer.java 30 Apr 2003 04:38:48 -0000 1.5 >+++ SSTDeserializer.java 11 Sep 2003 19:41:28 -0000 >@@ -132,8 +132,16 @@ > if ( stringContinuesOverContinuation ) > { > int remainingBytes = ( initialOffset + dataSize ) - offset - stringHeaderOverhead(); >- setContinuationExpectedChars( charCount - calculateCharCount( remainingBytes ) ); >- charCount -= getContinuationExpectedChars(); >+ int continuationChars = charCount - calculateCharCount( remainingBytes ); >+ if ( continuationChars > 0 ) >+ { >+ setContinuationExpectedChars(continuationChars); >+ charCount -= getContinuationExpectedChars(); >+ } >+ else // set number of chars to skip in next record >+ { >+ setContinuationExpectedChars( remaining - totalStringSize() ); >+ } > } > else > { >@@ -238,7 +246,7 @@ > > private boolean isStringFinished() > { >- return getContinuationExpectedChars() == 0; >+ return getContinuationExpectedChars() <= 0; > } > > /** >@@ -301,8 +309,11 @@ > { > if ( isStringFinished() ) > { >+ // this is to skip the trailing extra info from prior string >+ int newOffset = -getContinuationExpectedChars(); >+ > initVars(); >- manufactureStrings( record, 0, (short) record.length ); >+ manufactureStrings( record, newOffset, (short) ( record.length - newOffset) ); > } > else > { >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 23083
:
8164
|
8165
|
8166
| 8168 |
8222