Bug 47363 - Adding data validations after sheet protection causes IllegalStateException
Summary: Adding data validations after sheet protection causes IllegalStateException
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.5-dev
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL: http://mail-archives.apache.org/mod_m...
Depends on:
Reported: 2009-06-12 12:11 UTC by Josh Micich
Modified: 2009-06-12 12:28 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Josh Micich 2009-06-12 12:11:50 UTC
java.lang.IllegalStateException: Unexpected (org.apache.poi.hssf.record.PasswordRecord) while looking for DV Table insert pos
	at org.apache.poi.hssf.model.RecordOrderer.findDataValidationTableInsertPos(RecordOrderer.java:240)
	at org.apache.poi.hssf.model.RecordOrderer.findSheetInsertPos(RecordOrderer.java:95)
	at org.apache.poi.hssf.model.RecordOrderer.addNewSheetRecord(RecordOrderer.java:89)
	at org.apache.poi.hssf.model.Sheet.getOrCreateDataValidityTable(Sheet.java:1752)
	at org.apache.poi.hssf.usermodel.HSSFSheet.addValidationData(HSSFSheet.java:369)
Comment 1 Josh Micich 2009-06-12 12:28:36 UTC
Fixed in svn r784240

junits added

The problem was due to the PASSWORD record being added in the wrong place (after DIMENSION).  PASSWORD is part of the 'Worksheet Protection Block' which should be before DIMENSION.