Bug 51577

Summary: [PATCH] hslf: relax restrictions for sheet text runs
Product: POI Reporter: Gary King <gking>
Component: HSLFAssignee: POI Developers List <dev>
Severity: normal Keywords: PatchAvailable
Priority: P2    
Version: 3.8-dev   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: git-format-patch svn-id trunk@1150704

Description Gary King 2011-07-28 17:42:54 UTC
Created attachment 27328 [details]
git-format-patch svn-id trunk@1150704

The Sheet::findTextRun method made a number of incorrect assumptions about the structure of atoms following a TextHeaderAtom, resulting in a number of error messages being spewed to stderr for PowerPoint files which did not match its expectations.

Some of the cases I have seen which POI is incorrectly handling include:

* A TextHeaderAtom immediately following a TextHeaderAtom

* TextRulerAtoms and MasterTextPropAtoms between a TextHeaderAtom and the corresponding TextCharAtom / TextBytesAtom
Comment 1 Yegor Kozlov 2012-02-22 12:27:03 UTC
The patch looks OK but I'm reluctant to apply it without a unit test. 

Can you upload a junit test that covers the cases that POI currently does not handle? 

Comment 2 Andreas Beeker 2015-11-09 21:58:37 UTC
I think I've handled those cases when I've rewritten the text handling.
If this still throws exceptions for your files, please attach them and I'll try 
to figure out what's wrong.