From 123661b5ab0c94ff825ed9915c3e043388d8af67 Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Sun, 2 Oct 2011 00:30:52 +0000 Subject: [PATCH] correctly handle 2-byte properties git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1178107 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/hpsf/MutableProperty.java | 7 +++++++ 1 file changed, 7 insertions(+) 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;