slaubach 2002/10/04 13:28:27 Modified: src/java/org/apache/poi/hssf/record FormatRecord.java Log: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13248 Revision Changes Path 1.6 +26 -3 jakarta-poi/src/java/org/apache/poi/hssf/record/FormatRecord.java Index: FormatRecord.java =================================================================== RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/hssf/record/FormatRecord.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- FormatRecord.java 2 Sep 2002 02:11:15 -0000 1.5 +++ FormatRecord.java 4 Oct 2002 20:28:27 -0000 1.6 @@ -64,6 +64,7 @@ * * REFERENCE: PG 317 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)<P> * @author Andrew C. Oliver (acoliver at apache dot org) + * @author Shawn M. Laubach (shawnlaubach at cox dot net) * @version 2.0-pre */ @@ -72,7 +73,7 @@ { public final static short sid = 0x41e; private short field_1_index_code; - private byte field_2_formatstring_len; + private short field_2_formatstring_len; private short field_3_unicode_len; // unicode string length private boolean field_3_unicode_flag; // it is not undocumented - it is unicode flag private String field_4_formatstring; @@ -121,6 +122,7 @@ field_1_index_code = LittleEndian.getShort(data, 0 + offset); // field_2_formatstring_len = data[ 2 + offset ]; field_3_unicode_len = LittleEndian.getShort( data, 2 + offset ); + field_2_formatstring_len = field_3_unicode_len; field_3_unicode_flag = ( data[ 4 + offset ] & (byte)0x01 ) != 0; @@ -156,6 +158,17 @@ public void setFormatStringLength(byte len) { field_2_formatstring_len = len; + field_3_unicode_len = len; + } + + /** + * set whether the string is unicode + * + * @param unicode flag for whether string is unicode + */ + + public void setUnicodeFlag(boolean unicode) { + field_3_unicode_flag = unicode; } /** @@ -189,10 +202,20 @@ * @see #getFormatString() */ - public byte getFormatStringLength() + public short getFormatStringLength() { - return field_2_formatstring_len; + return field_3_unicode_flag ? field_3_unicode_len : field_2_formatstring_len; } + + /** + * get whether the string is unicode + * + * @return flag for whether string is unicode + */ + + public boolean getUnicodeFlag() { + return field_3_unicode_flag; + } /** * get the format string
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
