aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi/hpsf
diff options
context:
space:
mode:
authorSergey Vladimirov <sergey@apache.org>2011-10-02 00:30:52 +0000
committerSergey Vladimirov <sergey@apache.org>2011-10-02 00:30:52 +0000
commit123661b5ab0c94ff825ed9915c3e043388d8af67 (patch)
treeb14229c6ec36eb77b868e2e1d8f318ab0bbd4c0d /src/java/org/apache/poi/hpsf
parent5351f594efe24adc52e56f669439e2bdfb7bba2d (diff)
downloadpoi-123661b5ab0c94ff825ed9915c3e043388d8af67.tar.gz
poi-123661b5ab0c94ff825ed9915c3e043388d8af67.zip
correctly handle 2-byte properties
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1178107 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi/hpsf')
-rw-r--r--src/java/org/apache/poi/hpsf/MutableProperty.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/java/org/apache/poi/hpsf/MutableProperty.java b/src/java/org/apache/poi/hpsf/MutableProperty.java
index 401ac232c8..99ed245395 100644
--- a/src/java/org/apache/poi/hpsf/MutableProperty.java
+++ b/src/java/org/apache/poi/hpsf/MutableProperty.java
@@ -108,6 +108,13 @@ public class MutableProperty extends Property
int length = 0;
long variantType = getType();
+ if ( variantType == 0x0002 )
+ {
+ TypeWriter
+ .writeToStream( out, ( (Number) getValue() ).shortValue() );
+ return 2;
+ }
+
/* Ensure that wide strings are written if the codepage is Unicode. */
if (codepage == Constants.CP_UNICODE && variantType == Variant.VT_LPSTR)
variantType = Variant.VT_LPWSTR;