<!-- Don't forget to update status.xml too! -->
<release version="3.0.2-FINAL" date="2007-??-??">
+ <action dev="POI-DEVELOPERS" type="add">41064 - [PATCH] Support for String continue records</action>
<action dev="POI-DEVELOPERS" type="add">27511 - [PATCH] Support for data validation, via DVRecord and DVALRecord</action>
<action dev="POI-DEVELOPERS" type="fix">43877 and 39512 - Fix for handling mixed OBJ and CONTINUE records.</action>
<action dev="POI-DEVELOPERS" type="fix">43807 - Throw an IllegalArgumentException if asked to create a merged region with invalid columns or rows, rather than writing out a corrupt file</action>
<!-- Don't forget to update changes.xml too! -->
<changes>
<release version="3.0.2-FINAL" date="2007-??-??">
+ <action dev="POI-DEVELOPERS" type="add">41064 - [PATCH] Support for String continue records</action>
<action dev="POI-DEVELOPERS" type="add">27511 - [PATCH] Support for data validation, via DVRecord and DVALRecord</action>
<action dev="POI-DEVELOPERS" type="fix">43877 - Fix for handling mixed OBJ and CONTINUE records</action>
<action dev="POI-DEVELOPERS" type="fix">39512 - Fix for handling mixed OBJ and CONTINUE records</action>
} else if (record.getSid() == ContinueRecord.sid &&
(lastRecord instanceof DrawingGroupRecord)) {
((DrawingGroupRecord)lastRecord).processContinueRecord(((ContinueRecord)record).getData());
+ } else if (record.getSid() == ContinueRecord.sid &&
+ (lastRecord instanceof StringRecord)) {
+ ((StringRecord)lastRecord).processContinueRecord(((ContinueRecord)record).getData());
} else if (record.getSid() == ContinueRecord.sid) {
if (lastRecord instanceof UnknownRecord) {
//Gracefully handle records that we dont know about,
field_3_string = StringUtil.getFromCompressedUnicode(data, 0, field_1_string_length);
}
}
+
+ public void processContinueRecord(byte[] data) {
+ if(isUnCompressedUnicode()) {
+ field_3_string += StringUtil.getFromUnicodeLE(data, 0, field_1_string_length - field_3_string.length());
+ } else {
+ field_3_string += StringUtil.getFromCompressedUnicode(data, 0, field_1_string_length - field_3_string.length());
+ }
+ }
public boolean isInValueSection()
{
final int offset,
final int len) {
try {
- return new String(string, offset, len, "ISO-8859-1");
+ int len_to_use = Math.min(len, string.length - offset);
+ return new String(string, offset, len_to_use, "ISO-8859-1");
} catch (UnsupportedEncodingException e) {
throw new InternalError(); /* unreachable */
}
);
}
+ public void testwithContinueRecords() throws Exception {
+ String path = System.getProperty("HSSF.testdata.path");
+ FileInputStream fin = new FileInputStream(path + File.separator + "StringContinueRecords.xls");
+
+ ExcelExtractor extractor = new ExcelExtractor(new POIFSFileSystem(fin));
+
+ extractor.getText();
+
+ // Has masses of text
+ // Until we fixed bug #41064, this would've
+ // failed by now
+ assertTrue(extractor.getText().length() > 40960);
+ }
public void testStringConcat() throws Exception {
String path = System.getProperty("HSSF.testdata.path");