aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShawn Laubach <slaubach@apache.org>2002-10-04 20:28:27 +0000
committerShawn Laubach <slaubach@apache.org>2002-10-04 20:28:27 +0000
commit9d431f8bde6e9674c70d6654639bc74d4eed557e (patch)
tree600636b953e1ddd408ebde2332506b7db0ab4382 /src
parentd52c2acdeeb153cf5cdf3413be203c1cc2feea04 (diff)
downloadpoi-9d431f8bde6e9674c70d6654639bc74d4eed557e.tar.gz
poi-9d431f8bde6e9674c70d6654639bc74d4eed557e.zip
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13248
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352878 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/poi/hssf/record/FormatRecord.java29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/java/org/apache/poi/hssf/record/FormatRecord.java b/src/java/org/apache/poi/hssf/record/FormatRecord.java
index 1d36924e0f..5a72c9be41 100644
--- a/src/java/org/apache/poi/hssf/record/FormatRecord.java
+++ b/src/java/org/apache/poi/hssf/record/FormatRecord.java
@@ -64,6 +64,7 @@ import org.apache.poi.util.StringUtil;
*
* 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 class FormatRecord
{
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 @@ public class FormatRecord
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 class FormatRecord
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,12 +202,22 @@ public class FormatRecord
* @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
*
* @return the format string