diff options
author | Sergey Vladimirov <sergey@apache.org> | 2011-10-02 00:30:52 +0000 |
---|---|---|
committer | Sergey Vladimirov <sergey@apache.org> | 2011-10-02 00:30:52 +0000 |
commit | 123661b5ab0c94ff825ed9915c3e043388d8af67 (patch) | |
tree | b14229c6ec36eb77b868e2e1d8f318ab0bbd4c0d /src/java/org/apache/poi/hpsf | |
parent | 5351f594efe24adc52e56f669439e2bdfb7bba2d (diff) | |
download | poi-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.java | 7 |
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; |