Bug 41711

Summary: Better exception for PowerPoint documents from unsupported versions
Product: POI Reporter: Trejkaz (pen name) <trejkaz>
Component: HSLFAssignee: POI Developers List <dev>
Severity: enhancement    
Priority: P2    
Version: 3.0-dev   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: Example PowerPoint 95 document

Description Trejkaz (pen name) 2007-02-26 19:12:59 UTC
At the moment when constructing a CurrentUserAtom, a
CorruptPowerPointFileException is thrown when the atom is of the incorrect
length.  Problem is, this document may not be corrupt, but may instead come from
a different version of PowerPoint.

I would suggest throwing a WrongPowerPointVersionException exception, or
similar, if the length is incorrect or if the magic number is not matched.
Comment 1 Nick Burch 2007-03-01 07:40:10 UTC
I think we should only through something like WrongPowerPointVersionException if
we can detect that. Most of the cases I've seen with broken CurrentUserAtoms
really have been corrupt files.

If you can upload a sample file from an older version of PPT with a short
CurrentUserAtom, I'll look at detecting that and returning a more useful exception.
Comment 2 Trejkaz (pen name) 2007-03-01 20:08:28 UTC
The way we currently detect if the PowerPoint document is of the form HSLF
supports, is to open the CurrentUserAtom and look for the magic number.  If it
isn't there, then we consider that it isn't of the right version, and so far
that's been good enough since Office was able to open the remaining ones.
Comment 3 Trejkaz (pen name) 2007-03-01 20:36:41 UTC
Created attachment 19655 [details]
Example PowerPoint 95 document
Comment 4 Nick Burch 2009-05-16 13:51:47 UTC
I've added OldPowerPointFormatException, which CurrentUserAtom will now throw if it detects a ppt95 file
Comment 5 Trejkaz (pen name) 2009-10-29 16:18:44 UTC
Noting that this works for our test data, including all the ones we didn't attach.