From 60511a769d2272af64c9bd978cf4b278f0313f87 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Sat, 28 Jun 2008 17:04:09 +0000 Subject: [PATCH] Finish the EventWorkbookBuilder, now does sheet references in formulas properly git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@672550 13f79535-47bb-0310-9956-ffa450edef68 --- .../eventusermodel/EventWorkbookBuilder.java | 12 ++++--- .../TestEventWorkbookBuilder.java | 34 +++++++++++++++---- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java b/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java index 6040bb5801..0ae5f3f260 100644 --- a/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java +++ b/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java @@ -26,6 +26,7 @@ import org.apache.poi.hssf.record.EOFRecord; import org.apache.poi.hssf.record.ExternSheetRecord; import org.apache.poi.hssf.record.Record; import org.apache.poi.hssf.record.SSTRecord; +import org.apache.poi.hssf.record.SupBookRecord; import org.apache.poi.hssf.usermodel.HSSFWorkbook; /** @@ -84,16 +85,19 @@ public class EventWorkbookBuilder { wbRecords.add(sst); } - // Next we need an EoF record - wbRecords.add(new EOFRecord()); - - // Now e can have the ExternSheetRecords + // Now we can have the ExternSheetRecords, + // preceded by a SupBookRecord if(externs != null) { + wbRecords.add(SupBookRecord.createInternalReferences( + (short)externs.length)); for(int i=0; i