Lines 46-52
Link Here
|
46 |
private static final int OFFSET_ESCAPEMENT_TYPE_MODIFIED = 92; |
46 |
private static final int OFFSET_ESCAPEMENT_TYPE_MODIFIED = 92; |
47 |
private static final int OFFSET_UNDERLINE_TYPE_MODIFIED = 96; |
47 |
private static final int OFFSET_UNDERLINE_TYPE_MODIFIED = 96; |
48 |
private static final int OFFSET_FONT_WEIGHT_MODIFIED = 100; |
48 |
private static final int OFFSET_FONT_WEIGHT_MODIFIED = 100; |
49 |
private static final int OFFSET_NOT_USED = 104; |
49 |
private static final int OFFSET_NOT_USED1 = 104; |
|
|
50 |
private static final int OFFSET_NOT_USED2 = 108; |
51 |
private static final int OFFSET_NOT_USED3 = 112; // for some reason Excel always writes 0x7FFFFFFF at this offset |
50 |
private static final int OFFSET_FONT_FORMATING_END = 116; |
52 |
private static final int OFFSET_FONT_FORMATING_END = 116; |
51 |
|
53 |
|
52 |
|
54 |
|
Lines 140-146
Link Here
|
140 |
this.setUnderlineTypeModified(false); |
142 |
this.setUnderlineTypeModified(false); |
141 |
|
143 |
|
142 |
LittleEndian.putShort(record, OFFSET_FONT_NAME, (short)0); |
144 |
LittleEndian.putShort(record, OFFSET_FONT_NAME, (short)0); |
143 |
LittleEndian.putInt(record, OFFSET_NOT_USED, 0x00000001); |
145 |
LittleEndian.putInt(record, OFFSET_NOT_USED1, 0x00000001); |
|
|
146 |
LittleEndian.putInt(record, OFFSET_NOT_USED2, 0x00000000); |
147 |
LittleEndian.putInt(record, OFFSET_NOT_USED3, 0x7FFFFFFF);// for some reason Excel always writes 0x7FFFFFFF at this offset |
144 |
LittleEndian.putShort(record, OFFSET_FONT_FORMATING_END, (short)0x0001); |
148 |
LittleEndian.putShort(record, OFFSET_FONT_FORMATING_END, (short)0x0001); |
145 |
} |
149 |
} |
146 |
|
150 |
|
Lines 551-578
Link Here
|
551 |
} |
555 |
} |
552 |
buffer.append(" .color index = ").append("0x"+Integer.toHexString(getFontColorIndex()).toUpperCase()).append("\n"); |
556 |
buffer.append(" .color index = ").append("0x"+Integer.toHexString(getFontColorIndex()).toUpperCase()).append("\n"); |
553 |
|
557 |
|
554 |
|
|
|
555 |
buffer.append(" ====\n"); |
556 |
buffer.append(" ["+OFFSET_FONT_HEIGHT+"] FONT HEIGHT: "+intToHex(OFFSET_FONT_HEIGHT)+"\n"); |
557 |
buffer.append(" ["+OFFSET_FONT_OPTIONS+"] FONT OPTIONS: "+intToHex(OFFSET_FONT_OPTIONS)+"\n"); |
558 |
buffer.append(" ["+OFFSET_FONT_WEIGHT+"] FONT WEIGHT: "+shortToHex(OFFSET_FONT_WEIGHT)+"\n"); |
559 |
buffer.append(" ["+OFFSET_ESCAPEMENT_TYPE+"] FONT ESCAPEMENT: "+shortToHex(OFFSET_ESCAPEMENT_TYPE)+"\n"); |
560 |
buffer.append(" ["+OFFSET_UNDERLINE_TYPE+"] FONT UNDERLINE: "+byteToHex(OFFSET_UNDERLINE_TYPE)+"\n"); |
561 |
buffer.append(" ["+(OFFSET_UNDERLINE_TYPE+1)+"] FONT NOT USED: "+byteToHex(OFFSET_UNDERLINE_TYPE+1)+"\n"); |
562 |
buffer.append(" ["+(OFFSET_UNDERLINE_TYPE+2)+"] FONT NOT USED: "+byteToHex(OFFSET_UNDERLINE_TYPE+2)+"\n"); |
563 |
buffer.append(" ["+(OFFSET_UNDERLINE_TYPE+3)+"] FONT NOT USED: "+byteToHex(OFFSET_UNDERLINE_TYPE+3)+"\n"); |
564 |
buffer.append(" ["+OFFSET_FONT_COLOR_INDEX+"] FONT COLIDX: "+intToHex(OFFSET_FONT_COLOR_INDEX)+"\n"); |
565 |
buffer.append(" ["+(OFFSET_FONT_COLOR_INDEX+4)+"] FONT NOT USED: "+intToHex(OFFSET_FONT_COLOR_INDEX+4)+"\n"); |
566 |
buffer.append(" ["+OFFSET_OPTION_FLAGS+"] FONT OPTIONS: "+intToHex(OFFSET_OPTION_FLAGS)+"\n"); |
567 |
buffer.append(" ["+OFFSET_ESCAPEMENT_TYPE_MODIFIED+"] FONT ESC MOD: "+intToHex(OFFSET_ESCAPEMENT_TYPE_MODIFIED)+"\n"); |
568 |
buffer.append(" ["+OFFSET_UNDERLINE_TYPE_MODIFIED+"] FONT UND MOD: "+intToHex(OFFSET_UNDERLINE_TYPE_MODIFIED)+"\n"); |
569 |
buffer.append(" ["+OFFSET_FONT_WEIGHT+"] FONT WGH MOD: "+intToHex(OFFSET_FONT_WEIGHT)+"\n"); |
570 |
buffer.append(" ["+OFFSET_NOT_USED+"] FONT NOT USED: "+intToHex(OFFSET_NOT_USED)+"\n"); |
571 |
buffer.append(" ["+(OFFSET_NOT_USED+4)+"] FONT NOT USED: "+intToHex(OFFSET_NOT_USED+4)+"\n"); |
572 |
buffer.append(" ["+(OFFSET_NOT_USED+8)+"] FONT NOT USED: "+intToHex(OFFSET_NOT_USED+8)+"\n"); |
573 |
buffer.append(" ["+OFFSET_FONT_FORMATING_END+"] FONT FORMATTING END: "+shortToHex(OFFSET_FONT_FORMATING_END)+"\n"); |
574 |
buffer.append(" ====\n"); |
575 |
|
576 |
buffer.append(" [/Font Formatting]\n"); |
558 |
buffer.append(" [/Font Formatting]\n"); |
577 |
return buffer.toString(); |
559 |
return buffer.toString(); |
578 |
} |
560 |
} |
Lines 589-605
Link Here
|
589 |
return rec; |
571 |
return rec; |
590 |
} |
572 |
} |
591 |
|
573 |
|
592 |
private String intToHex(int offset) |
|
|
593 |
{ |
594 |
return Integer.toHexString(LittleEndian.getInt(record, offset)); |
595 |
} |
596 |
private String shortToHex(int offset) |
597 |
{ |
598 |
return Integer.toHexString(LittleEndian.getShort(record, offset)&0xFFFF); |
599 |
} |
600 |
private String byteToHex(int offset) |
601 |
{ |
602 |
return Integer.toHexString(record[offset]&0xFF); |
603 |
} |
604 |
|
605 |
} |
574 |
} |