PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352929 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6d084e9831
commit
5ab7cb4360
@ -88,6 +88,7 @@ import org.apache.poi.hssf.util.HSSFColor;
|
|||||||
* @author Andrew C. Oliver (acoliver at apache dot org)
|
* @author Andrew C. Oliver (acoliver at apache dot org)
|
||||||
* @author Glen Stampoultzis (glens at apache.org)
|
* @author Glen Stampoultzis (glens at apache.org)
|
||||||
* @author Sergei Kozello (sergeikozello at mail.ru)
|
* @author Sergei Kozello (sergeikozello at mail.ru)
|
||||||
|
* @author Luc Girardin (luc dot girardin at macrofocus dot com)
|
||||||
* @see org.apache.poi.hssf.usermodel.HSSFWorkbook
|
* @see org.apache.poi.hssf.usermodel.HSSFWorkbook
|
||||||
* @version 1.0-pre
|
* @version 1.0-pre
|
||||||
*/
|
*/
|
||||||
@ -670,8 +671,11 @@ public class Workbook implements Model {
|
|||||||
|
|
||||||
// byte[] rec = (( byte [] ) bytes.get(k));
|
// byte[] rec = (( byte [] ) bytes.get(k));
|
||||||
// System.arraycopy(rec, 0, retval, pos, rec.length);
|
// System.arraycopy(rec, 0, retval, pos, rec.length);
|
||||||
pos += (( Record ) records.get(k)).serialize(pos,
|
Record record = (( Record ) records.get(k));
|
||||||
retval); // rec.length;
|
// Let's skip RECALCID records, as they are only use for optimization
|
||||||
|
if(record.getSid() != RecalcIdRecord.sid || ((RecalcIdRecord)record).isNeeded()) {
|
||||||
|
pos += record.serialize(pos, retval); // rec.length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
log.log(DEBUG, "Exiting serialize workbook");
|
log.log(DEBUG, "Exiting serialize workbook");
|
||||||
return retval;
|
return retval;
|
||||||
@ -704,8 +708,11 @@ public class Workbook implements Model {
|
|||||||
|
|
||||||
// byte[] rec = (( byte [] ) bytes.get(k));
|
// byte[] rec = (( byte [] ) bytes.get(k));
|
||||||
// System.arraycopy(rec, 0, data, offset + pos, rec.length);
|
// System.arraycopy(rec, 0, data, offset + pos, rec.length);
|
||||||
pos += (( Record ) records.get(k)).serialize(pos + offset,
|
Record record = (( Record ) records.get(k));
|
||||||
data); // rec.length;
|
// Let's skip RECALCID records, as they are only use for optimization
|
||||||
|
if(record.getSid() != RecalcIdRecord.sid || ((RecalcIdRecord)record).isNeeded()) {
|
||||||
|
pos += record.serialize(pos + offset, data); // rec.length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
log.log(DEBUG, "Exiting serialize workbook");
|
log.log(DEBUG, "Exiting serialize workbook");
|
||||||
return pos;
|
return pos;
|
||||||
@ -715,7 +722,11 @@ public class Workbook implements Model {
|
|||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
for (int k = 0; k < records.size(); k++) {
|
for (int k = 0; k < records.size(); k++) {
|
||||||
retval += (( Record ) records.get(k)).getRecordSize();
|
Record record = (( Record ) records.get(k));
|
||||||
|
// Let's skip RECALCID records, as they are only use for optimization
|
||||||
|
if(record.getSid() != RecalcIdRecord.sid || ((RecalcIdRecord)record).isNeeded()) {
|
||||||
|
retval += record.getRecordSize();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ public class RecordFactory
|
|||||||
FormulaRecord.class, BoolErrRecord.class, ExternSheetRecord.class,
|
FormulaRecord.class, BoolErrRecord.class, ExternSheetRecord.class,
|
||||||
NameRecord.class, LeftMarginRecord.class, RightMarginRecord.class,
|
NameRecord.class, LeftMarginRecord.class, RightMarginRecord.class,
|
||||||
TopMarginRecord.class, BottomMarginRecord.class,
|
TopMarginRecord.class, BottomMarginRecord.class,
|
||||||
PaletteRecord.class, StringRecord.class
|
PaletteRecord.class, StringRecord.class, RecalcIdRecord.class
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
records = new Class[]
|
records = new Class[]
|
||||||
@ -142,7 +142,7 @@ public class RecordFactory
|
|||||||
BoolErrRecord.class, ExternSheetRecord.class, NameRecord.class,
|
BoolErrRecord.class, ExternSheetRecord.class, NameRecord.class,
|
||||||
LeftMarginRecord.class, RightMarginRecord.class,
|
LeftMarginRecord.class, RightMarginRecord.class,
|
||||||
TopMarginRecord.class, BottomMarginRecord.class,
|
TopMarginRecord.class, BottomMarginRecord.class,
|
||||||
PaletteRecord.class, StringRecord.class
|
PaletteRecord.class, StringRecord.class, RecalcIdRecord.class
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user