aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2014-07-19 19:10:47 +0000
committerNick Burch <nick@apache.org>2014-07-19 19:10:47 +0000
commit0bfa4f675d87381bd5521c85a119769d9c8ed786 (patch)
treea16d4db91ad499842f87749fd3e0b34e00ed5dbe /src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java
parent7a372e6f361d6e27f98c16a6c8debf7976e886f0 (diff)
downloadpoi-0bfa4f675d87381bd5521c85a119769d9c8ed786.tar.gz
poi-0bfa4f675d87381bd5521c85a119769d9c8ed786.zip
The Event User Model fake-workbook for formula evaluations needs to know about the sheet names
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1611946 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java')
-rw-r--r--src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java b/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java
index c6036d6582..b0d0388a2c 100644
--- a/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java
+++ b/src/java/org/apache/poi/hssf/eventusermodel/EventWorkbookBuilder.java
@@ -138,7 +138,14 @@ public class EventWorkbookBuilder {
}
public HSSFWorkbook getStubHSSFWorkbook() {
- return HSSFWorkbook.create(getStubWorkbook());
+ // Create a base workbook
+ HSSFWorkbook wb = HSSFWorkbook.create(getStubWorkbook());
+ // Stub the sheets, so sheet name lookups work
+ for (BoundSheetRecord bsr : boundSheetRecords) {
+ wb.createSheet(bsr.getSheetname());
+ }
+ // Ready for Formula use!
+ return wb;
}
public InternalWorkbook getStubWorkbook() {
return createStubWorkbook(