From: Nick Burch Date: Tue, 23 Nov 2010 13:04:03 +0000 (+0000) Subject: Stub out a bit more for XSSF event processing of shared formulas, and only warn about... X-Git-Tag: REL_3_8_BETA1~117 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1a8b1fbf8cd7e9b7dcf3b2912dcc31ac237f8dba;p=poi.git Stub out a bit more for XSSF event processing of shared formulas, and only warn about them if the formula is a shared-child + the user actually wants the values git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1038095 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java index df16a97abd..c08f14c5d5 100644 --- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java +++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java @@ -130,9 +130,27 @@ public class XSSFSheetXMLHandler extends DefaultHandler { } // Decide where to get the formula string from - String type = attributes.getValue("t"); + String type = attributes.getValue("t"); if(type != null && type.equals("shared")) { - System.err.println("Warning - shared formulas not yet supported!"); + // Is it the one that defines the shared, or uses it? + String ref = attributes.getValue("ref"); + String si = attributes.getValue("si"); + + if(ref != null) { + // This one defines it + // TODO Save it somewhere + fIsOpen = true; + } else { + // This one uses a shared formula + // TODO Retrieve the shared formula and tweak it to + // match the current cell + if(formulasNotResults) { + System.err.println("Warning - shared formulas not yet supported!"); + } else { + // It's a shared formula, so we can't get at the formula string yet + // However, they don't care about the formula string, so that's ok! + } + } } else { fIsOpen = true; }