From 02f7229fa3b3357c6e8c29e051d8a9ee5566aa4c Mon Sep 17 00:00:00 2001 From: Sergey Vladimirov Date: Sun, 2 Oct 2011 00:59:03 +0000 Subject: [PATCH] pad VT_BOOL to 4 bytes git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1178112 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/hpsf/VariantSupport.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/java/org/apache/poi/hpsf/VariantSupport.java b/src/java/org/apache/poi/hpsf/VariantSupport.java index c320435c2..1075a9cf8 100644 --- a/src/java/org/apache/poi/hpsf/VariantSupport.java +++ b/src/java/org/apache/poi/hpsf/VariantSupport.java @@ -476,13 +476,14 @@ public class VariantSupport extends Variant { case Variant.VT_BOOL: { - int trueOrFalse; + short trueOrFalse; if ( ( (Boolean) value ).booleanValue() ) - trueOrFalse = 0xFFFF; + trueOrFalse = (short) 0xFFFF; else - trueOrFalse = 0x0000; + trueOrFalse = (short) 0x0000; TypeWriter.writeUShortToStream( out, trueOrFalse ); - length += 2; + TypeWriter.writeUShortToStream( out, (short) 0x0000 ); + length += 4; break; } case Variant.VT_LPSTR: