correctly handle 2-byte properties

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1178107 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sergey Vladimirov 2011-10-02 00:30:52 +00:00
parent 7233b20798
commit 4e52ab109c

View File

@ -108,6 +108,13 @@ public class MutableProperty extends Property
int length = 0; int length = 0;
long variantType = getType(); 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. */ /* Ensure that wide strings are written if the codepage is Unicode. */
if (codepage == Constants.CP_UNICODE && variantType == Variant.VT_LPSTR) if (codepage == Constants.CP_UNICODE && variantType == Variant.VT_LPSTR)
variantType = Variant.VT_LPWSTR; variantType = Variant.VT_LPWSTR;