From 27732b7287ebfd0bf72a86b9ff8f310884e07aad Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Fri, 6 May 2011 01:28:28 +0000 Subject: [PATCH] Fix bug #51153 - Correct sizing of LbsDataSubRecord with unused padding fields git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1100017 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/content/xdocs/status.xml | 1 + src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index a87636e9f7..f2ae43deb7 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ + 51153 - Correct sizing of LbsDataSubRecord with unused padding fields 51143 - NameCommentRecord correction for writing non ASCII strings 51112 - Correct XWPFTable tracking of new rows 51113 - Correct XWPFParagraph tracking of inserted runs diff --git a/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java b/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java index 62f1198869..c6255e7d3f 100644 --- a/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java +++ b/src/java/org/apache/poi/hssf/record/LbsDataSubRecord.java @@ -381,7 +381,7 @@ public class LbsDataSubRecord extends SubRecord { public int getDataSize() { int size = 6; size += StringUtil.getEncodedSize(_str); - size += _unused; + if(_unused != null) size++; return size; } -- 2.39.5