git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@544151 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7397304eed
commit
1a13734e19
@ -738,6 +738,7 @@ public class Workbook implements Model
|
|||||||
|
|
||||||
SSTRecord sst = null;
|
SSTRecord sst = null;
|
||||||
int sstPos = 0;
|
int sstPos = 0;
|
||||||
|
boolean wroteBoundSheets = false;
|
||||||
for ( int k = 0; k < records.size(); k++ )
|
for ( int k = 0; k < records.size(); k++ )
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -745,6 +746,7 @@ public class Workbook implements Model
|
|||||||
// Let's skip RECALCID records, as they are only use for optimization
|
// Let's skip RECALCID records, as they are only use for optimization
|
||||||
if ( record.getSid() != RecalcIdRecord.sid || ( (RecalcIdRecord) record ).isNeeded() )
|
if ( record.getSid() != RecalcIdRecord.sid || ( (RecalcIdRecord) record ).isNeeded() )
|
||||||
{
|
{
|
||||||
|
int len = 0;
|
||||||
if (record instanceof SSTRecord)
|
if (record instanceof SSTRecord)
|
||||||
{
|
{
|
||||||
sst = (SSTRecord)record;
|
sst = (SSTRecord)record;
|
||||||
@ -754,7 +756,17 @@ public class Workbook implements Model
|
|||||||
{
|
{
|
||||||
record = sst.createExtSSTRecord(sstPos + offset);
|
record = sst.createExtSSTRecord(sstPos + offset);
|
||||||
}
|
}
|
||||||
int len = record.serialize( pos + offset, data );
|
if (record instanceof BoundSheetRecord) {
|
||||||
|
if(!wroteBoundSheets) {
|
||||||
|
for (int i = 0; i < boundsheets.size(); i++) {
|
||||||
|
len+= ((BoundSheetRecord)boundsheets.get(i))
|
||||||
|
.serialize(pos+offset+len, data);
|
||||||
|
}
|
||||||
|
wroteBoundSheets = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
len = record.serialize( pos + offset, data );
|
||||||
|
}
|
||||||
///// DEBUG BEGIN /////
|
///// DEBUG BEGIN /////
|
||||||
// if (len != record.getRecordSize())
|
// if (len != record.getRecordSize())
|
||||||
// throw new IllegalStateException("Record size does not match serialized bytes. Serialized size = " + len + " but getRecordSize() returns " + record.getRecordSize());
|
// throw new IllegalStateException("Record size does not match serialized bytes. Serialized size = " + len + " but getRecordSize() returns " + record.getRecordSize());
|
||||||
|
@ -321,6 +321,7 @@ public class HSSFWorkbook
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public void setSheetOrder(String sheetname, int pos ) {
|
public void setSheetOrder(String sheetname, int pos ) {
|
||||||
|
sheets.add(pos,sheets.remove(getSheetIndex(sheetname)));
|
||||||
workbook.setSheetOrder(sheetname, pos);
|
workbook.setSheetOrder(sheetname, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user