Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag for Excel 4 macros in composite documents #436

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

kiddkaffeine
Copy link

This includes a composite (non-OOXML) Excel document with a Excel 4 macro. In the pre-OOXML world, these macros are binary and I'm not sure how to handle them, so this just marks their presence. (In OOXML, they're stored as text, but that come will later.)

Not sure how to unit test this without using EventFactory, am open to suggestions.

@pjfanning
Copy link
Contributor

I added this but then reverted it due to https://github.com/apache/poi/actions/runs/4452719179/jobs/7820620683

Causes issues like this:

Caused by: java.lang.IllegalStateException: bad function index (54, false)
	at org.apache.poi.ss.formula.ptg.AbstractFunctionPtg.lookupName(AbstractFunctionPtg.java:143)
	at org.apache.poi.ss.formula.ptg.FuncVarPtg.lookupName(FuncVarPtg.java:82)
	at org.apache.poi.ss.formula.ptg.AbstractFunctionPtg.getName(AbstractFunctionPtg.java:72)
	at org.apache.poi.ss.formula.ptg.AbstractFunctionPtg.toFormulaString(AbstractFunctionPtg.java:95)
	at org.apache.poi.ss.formula.FormulaRenderer.toFormulaString(FormulaRenderer.java:99)
	at org.apache.poi.hssf.model.HSSFFormulaParser.toFormulaString(HSSFFormulaParser.java:89)
	at org.apache.poi.hssf.usermodel.HSSFCell.getCellFormula(HSSFCell.java:643)
	at org.apache.poi.hssf.usermodel.HSSFCell.toString(HSSFCell.java:1045)
	at org.apache.poi.stress.SpreadsheetHandler.readContent(SpreadsheetHandler.java:84)
	at org.apache.poi.stress.SpreadsheetHandler.handleWorkbook(SpreadsheetHandler.java:38)
	at org.apache.poi.stress.HSSFFileHandler.handleFile(HSSFFileHandler.java:43)
	at org.apache.poi.stress.TestAllFiles.lambda$handleFile$1(TestAllFiles.java:209)
	at org.junit.jupiter.api.AssertDoesNotThrow.assertDoesNotThrow(AssertDoesNotThrow.java:49)
	... 41 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants