]> source.dussan.org Git - poi.git/commitdiff
correctly handle 2-byte properties
authorSergey Vladimirov <sergey@apache.org>
Sun, 2 Oct 2011 00:30:52 +0000 (00:30 +0000)
committerSergey Vladimirov <sergey@apache.org>
Sun, 2 Oct 2011 00:30:52 +0000 (00:30 +0000)
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

index 401ac232c884fed9bea921063eaf24b92d003fda..99ed245395b4c4f73b369cf821a45b50939ff1c8 100644 (file)
@@ -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;