Bug 58144 - Behaviour for headers and footers of slides is inconsistent between slideshows created in 2003 and 2007
Summary: Behaviour for headers and footers of slides is inconsistent between slideshow...
Alias: None
Product: POI
Classification: Unclassified
Component: SL Common (show other bugs)
Version: 3.15-dev
Hardware: All All
: P2 minor (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Blocks: 60003
  Show dependency tree
Reported: 2015-07-16 09:34 UTC by Trejkaz (pen name)
Modified: 2016-08-15 03:26 UTC (History)
0 users

Sample from 2003 (11.50 KB, application/vnd.ms-powerpoint)
2015-07-19 23:01 UTC, Trejkaz (pen name)
Sample from 2007 (136.00 KB, application/vnd.ms-powerpoint)
2015-07-19 23:02 UTC, Trejkaz (pen name)

Note You need to log in before you can comment on or make changes to this bug.
Description Trejkaz (pen name) 2015-07-16 09:34:27 UTC
PPT files created in 2007 return the headers and footers as text runs from Slide.getTextRuns().

PPT files created in 2003 don't.

Both of them return the headers and footers via getHeadersFooters(), of course.

This means that if you want to extract all the text, you can choose between two equally bad options:

  (a) Don't use getHeadersFooters(), and then earlier formats miss some
      of the text.

  (b) Do use getHeadersFooters(), and then later formats get some text
      doubled up.

It would be nice if either text runs which are part of the header or footer were automatically omitted, or if the older formats had additional text runs inserted so that both formats can be treated identically.

Via the usermodel, there doesn't appear to be any kind of API to distinguish the two, making it difficult to come up with a workaround.
Comment 1 Dominik Stadler 2015-07-16 11:18:49 UTC
Can you provide sample files and sample code which allow to see the differences without having to install both those versions of PowerPoint?
Comment 2 Trejkaz (pen name) 2015-07-19 23:01:57 UTC
Created attachment 32911 [details]
Sample from 2003
Comment 3 Trejkaz (pen name) 2015-07-19 23:02:13 UTC
Created attachment 32912 [details]
Sample from 2007
Comment 4 Trejkaz (pen name) 2015-07-19 23:02:53 UTC
Attaching some contrasting examples.
Comment 5 Andreas Beeker 2016-05-13 23:55:17 UTC
I've added a convenience method isHeaderOrFooter() to the TextParagraphs, so 
it's easy to distinguish between normal paragraphs and header/footer
Same applies for XSLF, i.e. it's available over the Common SL interface

Applied via r1743769