<!-- Don't forget to update status.xml too! -->
<release version="3.1.1-alpha1" date="2008-??-??">
+ <action dev="POI-DEVELOPERS" type="add">45175 - Support for variable length operands in org.apache.poi.hwpf.sprm.SprmOperation</action>
<action dev="POI-DEVELOPERS" type="fix">Avoid spurious missing lines with the MissingRecordAware event code, and odd files that contain RowRecords in the middle of the cell Records.</action>
<action dev="POI-DEVELOPERS" type="add">Support for parsing formulas during EventUserModel processing, via the new EventWorkbookBuilder</action>
</release>
<!-- Don't forget to update changes.xml too! -->
<changes>
<release version="3.1.1-alpha1" date="2008-??-??">
+ <action dev="POI-DEVELOPERS" type="add">45175 - Support for variable length operands in org.apache.poi.hwpf.sprm.SprmOperation</action>
<action dev="POI-DEVELOPERS" type="fix">Avoid spurious missing lines with the MissingRecordAware event code, and odd files that contain RowRecords in the middle of the cell Records.</action>
<action dev="POI-DEVELOPERS" type="add">Support for parsing formulas during EventUserModel processing, via the new EventWorkbookBuilder</action>
</release>
case 3:
return LittleEndian.getInt(_grpprl, _gOffset);
case 6:
- throw new UnsupportedOperationException("This SPRM contains a variable length operand");
+ byte operandLength = _grpprl[_gOffset + 1]; //surely shorter than an int...
+
+ byte [] codeBytes = new byte[LittleEndian.INT_SIZE]; //initialized to zeros by JVM
+ for(int i = 0; i < operandLength; i++)
+ if(_gOffset + i < _grpprl.length)
+ codeBytes[i] = _grpprl[_gOffset + 1 + i];
+
+ return LittleEndian.getInt(codeBytes, 0);
case 7:
byte threeByteInt[] = new byte[4];
threeByteInt[0] = _grpprl[_gOffset];
public void testNoExtraNewLines() throws Exception {
// Load a different file
openAlt();
- for(int i=0; i<r.length; i++) {
- System.err.println(r[i]);
- }
// This file has has something in lines 1-33