ASF Bugzilla – Attachment 21399 Details for
Bug 44254
Correct reading of records UncalcedRecord, DVALRecord and ErrPtg
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch file that modify the 3 records
records.patch (text/plain), 5.88 KB, created by
Olivier Leprince
on 2008-01-16 16:44:40 UTC
(
hide
)
Description:
Patch file that modify the 3 records
Filename:
MIME Type:
Creator:
Olivier Leprince
Created:
2008-01-16 16:44:40 UTC
Size:
5.88 KB
patch
obsolete
>Index: src/java/org/apache/poi/hssf/record/DVALRecord.java >=================================================================== >--- src/java/org/apache/poi/hssf/record/DVALRecord.java (revision 612520) >+++ src/java/org/apache/poi/hssf/record/DVALRecord.java (working copy) >@@ -31,17 +31,20 @@ > { > public final static short sid = 0x01B2; > >- //unknown field ; it's size should be 10 >- private short field_unknown = 0x0000; >+ /** Options of the DVAL */ >+ private short field_1_options; >+ /** Horizontal position of the dialog */ >+ private int field_2_horiz_pos; >+ /** Vertical position of the dialog */ >+ private int field_3_vert_pos; > >- //Object ID of the drop down arrow object for list boxes ; >- //in our case this will be always FFFF , until >- //MSODrawingGroup and MSODrawing records are implemented >+ /** Object ID of the drop down arrow object for list boxes ; >+ * in our case this will be always FFFF , until >+ * MSODrawingGroup and MSODrawing records are implemented */ > private int field_cbo_id = 0xFFFFFFFF; > >- //Number of following DV records >- //Default value is 1 >- private int field_3_dv_no = 0x00000000; >+ /** Number of following DV Records */ >+ private int field_5_dv_no = 0x00000000; > > public DVALRecord() > { >@@ -68,15 +71,37 @@ > > protected void fillFields(RecordInputStream in) > { >- for ( int i=0; i<5; i++) >- { >- this.field_unknown = in.readShort(); >- } >+ this.field_1_options = in.readShort(); >+ this.field_2_horiz_pos = in.readInt(); >+ this.field_3_vert_pos = in.readInt(); > this.field_cbo_id = in.readInt(); >- this.field_3_dv_no = in.readInt(); >+ this.field_5_dv_no = in.readInt(); > } > >+ >+ > /** >+ * @param field_1_options the options of the dialog >+ */ >+ public void setOptions(short field_1_options) { >+ this.field_1_options = field_1_options; >+ } >+ >+ /** >+ * @param field_2_horiz_pos the Horizontal position of the dialog >+ */ >+ public void setHorizontalPos(int field_2_horiz_pos) { >+ this.field_2_horiz_pos = field_2_horiz_pos; >+ } >+ >+ /** >+ * @param field_3_vert_pos the Vertical position of the dialog >+ */ >+ public void setVerticalPos(int field_3_vert_pos) { >+ this.field_3_vert_pos = field_3_vert_pos; >+ } >+ >+ /** > * set the object ID of the drop down arrow object for list boxes > * @param cboID - Object ID > */ >@@ -91,10 +116,33 @@ > */ > public void setDVRecNo(int dvNo) > { >- this.field_3_dv_no = dvNo; >+ this.field_5_dv_no = dvNo; > } > >+ >+ > /** >+ * @return the field_1_options >+ */ >+ public short getOptions() { >+ return field_1_options; >+ } >+ >+ /** >+ * @return the Horizontal position of the dialog >+ */ >+ public int getHorizontalPos() { >+ return field_2_horiz_pos; >+ } >+ >+ /** >+ * @return the the Vertical position of the dialog >+ */ >+ public int getVerticalPos() { >+ return field_3_vert_pos; >+ } >+ >+ /** > * get Object ID of the drop down arrow object for list boxes > */ > public int getObjectID( ) >@@ -107,7 +155,7 @@ > */ > public int getDVRecNo( ) > { >- return this.field_3_dv_no; >+ return this.field_5_dv_no; > } > > >@@ -116,6 +164,9 @@ > StringBuffer buffer = new StringBuffer(); > > buffer.append("[DVAL]\n"); >+ buffer.append(" .options = ").append(this.getOptions()).append('\n'); >+ buffer.append(" .horizPos = ").append(this.getHorizontalPos()).append('\n'); >+ buffer.append(" .vertPos = ").append(this.getVerticalPos()).append('\n'); > buffer.append(" .comboObjectID = ").append(Integer.toHexString(this.getObjectID())).append("\n"); > buffer.append(" .DVRecordsNumber = ").append(Integer.toHexString(this.getDVRecNo())).append("\n"); > buffer.append("[/DVAL]\n"); >@@ -126,10 +177,10 @@ > { > LittleEndian.putShort(data, 0 + offset, this.sid); > LittleEndian.putShort(data, 2 + offset, ( short)(this.getRecordSize()-4)); >- for ( int i=0; i<5; i++) >- { >- LittleEndian.putShort(data, 4 + i*2 + offset, (short)this.field_unknown); >- } >+ >+ LittleEndian.putShort(data, 4 + offset, this.getOptions()); >+ LittleEndian.putInt(data, 6 + offset, this.getHorizontalPos()); >+ LittleEndian.putInt(data, 10 + offset, this.getVerticalPos()); > LittleEndian.putInt(data, 14 + offset, this.getObjectID()); > LittleEndian.putInt(data, 18 + offset, this.getDVRecNo()); > return getRecordSize(); >@@ -149,9 +200,11 @@ > public Object clone() > { > DVALRecord rec = new DVALRecord(); >- rec.field_unknown = this.field_unknown; >+ rec.field_1_options = field_1_options; >+ rec.field_2_horiz_pos = field_2_horiz_pos; >+ rec.field_3_vert_pos = field_3_vert_pos; > rec.field_cbo_id = this.field_cbo_id; >- rec.field_3_dv_no = this.field_3_dv_no; >+ rec.field_5_dv_no = this.field_5_dv_no; > return rec; > } > } >\ No newline at end of file >Index: src/java/org/apache/poi/hssf/record/formula/ErrPtg.java >=================================================================== >--- src/java/org/apache/poi/hssf/record/formula/ErrPtg.java (revision 612520) >+++ src/java/org/apache/poi/hssf/record/formula/ErrPtg.java (working copy) >@@ -29,7 +29,7 @@ > public class ErrPtg extends Ptg > { > public static final short sid = 0x1c; >- private static final int SIZE = 7; >+ private static final int SIZE = 2; > private byte field_1_error_code; > > /** Creates new ErrPtg */ >Index: src/java/org/apache/poi/hssf/record/UncalcedRecord.java >=================================================================== >--- src/java/org/apache/poi/hssf/record/UncalcedRecord.java (revision 612520) >+++ src/java/org/apache/poi/hssf/record/UncalcedRecord.java (working copy) >@@ -55,6 +55,7 @@ > } > > protected void fillFields(RecordInputStream in) { >+ short unused = in.readShort(); > } > > public String toString() {
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 44254
: 21399