From 1c73dfaac895f9eee4345907196f02214dde5415 Mon Sep 17 00:00:00 2001 From: Glen Stampoultzis Date: Thu, 5 May 2005 13:06:06 +0000 Subject: [PATCH] Patch from Nick. Bug 34744 Fix for ddf.DefaultRecordFactory never creating EscherTextboxRecord git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353671 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/ddf/DefaultEscherRecordFactory.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java b/src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java index 1aa9c6ee7f..55cc3078c3 100644 --- a/src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java +++ b/src/java/org/apache/poi/ddf/DefaultEscherRecordFactory.java @@ -27,6 +27,8 @@ import java.util.Map; * Generates escher records when provided the byte array containing those records. * * @author Glen Stampoultzis + * @author Nick Burch (nick at torchbox . com) + * * @see EscherRecordFactory */ public class DefaultEscherRecordFactory @@ -57,8 +59,13 @@ public class DefaultEscherRecordFactory public EscherRecord createRecord( byte[] data, int offset ) { EscherRecord.EscherRecordHeader header = EscherRecord.EscherRecordHeader.readHeader( data, offset ); - if ( ( header.getOptions() & (short) 0x000F ) == (short) 0x000F ) - { + + // Options of 0x000F means container record + // However, EscherTextboxRecord are containers of records for the + // host application, not of other Escher records, so treat them + // differently + if ( ( header.getOptions() & (short) 0x000F ) == (short) 0x000F + && header.getRecordId() != EscherTextboxRecord.RECORD_ID ) { EscherContainerRecord r = new EscherContainerRecord(); r.setRecordId( header.getRecordId() ); r.setOptions( header.getOptions() );