Bug 51577 - [PATCH] hslf: relax restrictions for sheet text runs
Summary: [PATCH] hslf: relax restrictions for sheet text runs
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: 3.8-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Keywords: PatchAvailable
Depends on:
Reported: 2011-07-28 17:42 UTC by Gary King
Modified: 2015-11-09 21:58 UTC (History)
0 users

git-format-patch svn-id trunk@1150704 (4.23 KB, application/octet-stream)
2011-07-28 17:42 UTC, Gary King

Note You need to log in before you can comment on or make changes to this bug.
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.