ASF Bugzilla – Attachment 3412 Details for
Bug 13500
[PATCH] Record 1C1h (RecalcId)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to Workbook and RecordFactory classes
RecalcId.patch (text/plain), 3.98 KB, created by
Luc Girardin
on 2002-10-10 16:15:37 UTC
(
hide
)
Description:
Patch to Workbook and RecordFactory classes
Filename:
MIME Type:
Creator:
Luc Girardin
Created:
2002-10-10 16:15:37 UTC
Size:
3.98 KB
patch
obsolete
>? src/java/org/apache/poi/hssf/record/RecalcIdRecord.java >Index: src/java/org/apache/poi/hssf/model/Workbook.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/hssf/model/Workbook.java,v >retrieving revision 1.18 >diff -u -r1.18 Workbook.java >--- src/java/org/apache/poi/hssf/model/Workbook.java 5 Oct 2002 02:38:06 -0000 1.18 >+++ src/java/org/apache/poi/hssf/model/Workbook.java 10 Oct 2002 15:48:47 -0000 >@@ -88,6 +88,7 @@ > * @author Andrew C. Oliver (acoliver at apache dot org) > * @author Glen Stampoultzis (glens at apache.org) > * @author Sergei Kozello (sergeikozello at mail.ru) >+ * @author Luc Girardin (luc dot girardin at macrofocus dot com) > * @see org.apache.poi.hssf.usermodel.HSSFWorkbook > * @version 1.0-pre > */ >@@ -670,8 +671,11 @@ > > // byte[] rec = (( byte [] ) bytes.get(k)); > // System.arraycopy(rec, 0, retval, pos, rec.length); >- pos += (( Record ) records.get(k)).serialize(pos, >- retval); // rec.length; >+ 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()) { >+ pos += record.serialize(pos, retval); // rec.length; >+ } > } > log.log(DEBUG, "Exiting serialize workbook"); > return retval; >@@ -704,8 +708,11 @@ > > // byte[] rec = (( byte [] ) bytes.get(k)); > // System.arraycopy(rec, 0, data, offset + pos, rec.length); >- pos += (( Record ) records.get(k)).serialize(pos + offset, >- data); // rec.length; >+ 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()) { >+ pos += record.serialize(pos + offset, data); // rec.length; >+ } > } > log.log(DEBUG, "Exiting serialize workbook"); > return pos; >@@ -715,7 +722,11 @@ > int retval = 0; > > 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; > } >Index: src/java/org/apache/poi/hssf/record/RecordFactory.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/hssf/record/RecordFactory.java,v >retrieving revision 1.11 >diff -u -r1.11 RecordFactory.java >--- src/java/org/apache/poi/hssf/record/RecordFactory.java 29 Jul 2002 13:25:46 -0000 1.11 >+++ src/java/org/apache/poi/hssf/record/RecordFactory.java 10 Oct 2002 15:48:48 -0000 >@@ -109,7 +109,7 @@ > FormulaRecord.class, BoolErrRecord.class, ExternSheetRecord.class, > NameRecord.class, LeftMarginRecord.class, RightMarginRecord.class, > TopMarginRecord.class, BottomMarginRecord.class, >- PaletteRecord.class, StringRecord.class >+ PaletteRecord.class, StringRecord.class, RecalcIdRecord.class > }; > } else { > records = new Class[] >@@ -140,7 +140,7 @@ > BoolErrRecord.class, ExternSheetRecord.class, NameRecord.class, > LeftMarginRecord.class, RightMarginRecord.class, > TopMarginRecord.class, BottomMarginRecord.class, >- PaletteRecord.class, StringRecord.class >+ PaletteRecord.class, StringRecord.class, RecalcIdRecord.class > }; > > }
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 13500
: 3412 |
3413