aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlen Stampoultzis <glens@apache.org>2002-03-01 13:27:10 +0000
committerGlen Stampoultzis <glens@apache.org>2002-03-01 13:27:10 +0000
commitf2eda0957e3aa71140874295a9b02adf8b021f5d (patch)
tree29fac1a6458272ba8fda160f47a1156faacb938c
parentcc50a990d17581e99b94d57d161004701818755a (diff)
downloadpoi-f2eda0957e3aa71140874295a9b02adf8b021f5d.tar.gz
poi-f2eda0957e3aa71140874295a9b02adf8b021f5d.zip
Fixed some bad string length handling.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@352125 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/poi/hssf/record/BoundSheetRecord.java2
-rw-r--r--src/java/org/apache/poi/hssf/record/FontRecord.java2
-rw-r--r--src/java/org/apache/poi/hssf/record/FormatRecord.java2
-rw-r--r--src/java/org/apache/poi/hssf/record/StyleRecord.java2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java b/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java
index ee5db7229f..a897ee4acf 100644
--- a/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java
+++ b/src/java/org/apache/poi/hssf/record/BoundSheetRecord.java
@@ -126,7 +126,7 @@ public class BoundSheetRecord
field_3_sheetname_length = data[ 6 + offset ];
field_4_compressed_unicode_flag = data[ 7 + offset ];
field_5_sheetname = new String(data, 8 + offset,
- ( int ) field_3_sheetname_length);
+ LittleEndian.ubyteToInt( field_3_sheetname_length));
}
/**
diff --git a/src/java/org/apache/poi/hssf/record/FontRecord.java b/src/java/org/apache/poi/hssf/record/FontRecord.java
index e38676aadf..e07222913f 100644
--- a/src/java/org/apache/poi/hssf/record/FontRecord.java
+++ b/src/java/org/apache/poi/hssf/record/FontRecord.java
@@ -165,7 +165,7 @@ public class FontRecord
if (data[ 15 ] == 0)
{ // is compressed unicode
field_11_font_name = new String(data, 16,
- field_10_font_name_len);
+ LittleEndian.ubyteToInt(field_10_font_name_len));
}
else
{ // is not compressed unicode
diff --git a/src/java/org/apache/poi/hssf/record/FormatRecord.java b/src/java/org/apache/poi/hssf/record/FormatRecord.java
index 36075606d8..d541c3bc53 100644
--- a/src/java/org/apache/poi/hssf/record/FormatRecord.java
+++ b/src/java/org/apache/poi/hssf/record/FormatRecord.java
@@ -121,7 +121,7 @@ public class FormatRecord
field_2_formatstring_len = data[ 2 + offset ];
field_3_zero = LittleEndian.getShort(data, 3 + offset);
field_4_formatstring = new String(data, 5 + offset,
- field_2_formatstring_len);
+ LittleEndian.ubyteToInt(field_2_formatstring_len));
}
/**
diff --git a/src/java/org/apache/poi/hssf/record/StyleRecord.java b/src/java/org/apache/poi/hssf/record/StyleRecord.java
index 2ed737d3bc..3ce8c4ea91 100644
--- a/src/java/org/apache/poi/hssf/record/StyleRecord.java
+++ b/src/java/org/apache/poi/hssf/record/StyleRecord.java
@@ -135,7 +135,7 @@ public class StyleRecord
{
field_2_name_length = data[ 2 + offset ];
field_3_name = new String(data, 3 + offset,
- field_2_name_length);
+ LittleEndian.ubyteToInt(field_2_name_length));
}
// todo sanity check exception to make sure we're one or the other