poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 39547] - HSLF: IndexOutOfBoundsException in TextRun constructor
Date Fri, 16 Jun 2006 11:12:37 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39547>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39547





------- Additional Comments From yegor@dinom.ru  2006-06-16 11:12 -------
Hi Nick

>>Can you cast hslf.dev.SLWTListing over a bunch of your test files?

I have a similar utility but it dumps the content in XML.
 For me it is easier to analyze the structure of records if I work with a tree,
not with plain text.

>>I've been finding that the 2nd SLWT does seem to hold the slide's text, as your
>>research indicates. I've yet to find a document where that doesn't hold true.

The 2nd SLWT MAY not contain text, for example, if the slides don't have text
placeholders.
See the attached sample. Is it what you were looking for?

I ran hslf.dev.SLWTListing over a set of ppts and what I saw confirms
my suppositions about the order of slides.
So I suggest to commit this fix. 

To tell the truth I don't like how current SlideSHow.buildSlidesAndNotes is
organized. 
Many things are related to each other: getting slides in the correct order,
adding a new slide, saving ppt
and current code looks a bit clumsy to do all that. It works fine but
it is hard to support. In future we are going to deal with master
slides, reorder slides, do lots of other tricks and this code is a good
candidate to be refactored.

Below I will try to summarize what I know about SLWT:

(1) The 1st SLWT contains one or more SlidePersistAtoms.
I don't know if it can hold other records, so far I didn't see such ppt.
Each SlidePersistAtom refers to either a org.apache.poi.hslf.record.MainMaster
(not exists yet)
 or to a org.apache.poi.hslf.record.Slide. 
org.apache.poi.hslf.record.MainMaster describes slide master,
org.apache.poi.hslf.record.Slide describes title master.

 SlidePersistAtom.slideId is always negative in the 1st SLWT.

 Example in XML notation:

 <SlideListWithText>
   <SlidePersistAtom>
     <psrReference>1193</psrReference>  // either MainMaster or Slide
     <slideId>-2147483632</slideId>     // always negative
   </SlidePersistAtom>
   <SlidePersistAtom>
     <psrReference>1194</psrReference> 
     <slideId>-2147483631</slideId> 
     <Reserved>0</Reserved> 
   </SlidePersistAtom>
 </SlideListWithText>


(2) The 2nd SLWT contains one or more SlidePersistAtoms followed by atoms of
text placeholders (if a slide has any). 
If there is not the 2nd SLWT it means that the presentation does not contain
slides, i.e. it is empty. 

The order of slides is defined by the order of SPA in the second SLWT.

 Example in XML notation:

 <SlideListWithText>

   //the first slide
   <SlidePersistAtom> //there must be one SPA per each slide
     <psrReference>993</psrReference> // always  org.apache.poi.hslf.record.Slide
     <slideId>477</slideId> // slideId is positive for slides
     <numberTexts>1</numberTexts> //SPA knows about the number of subsequent texts
    </SlidePersistAtom>
        
   //below follow the atoms of text placeholders
   <TextHeaderAtom type="0"/> 
   <TextBytesAtom>Text in a Title Placeholder</TextBytesAtom> 
   <StyleTextPropAtom/> //optional

   //the second slide
   <SlidePersistAtom>
     <psrReference>1191</psrReference> 
     <slideId>533</slideId> 
   </SlidePersistAtom>


 </SlideListWithText>

Note, the actual number of slides is calculated as DocumentAtom.firstSlideNum + idx
where idx is the 0-based index of the SPA. You can play with this setting in the
PageSetup dialog.

(3) The 3rd SLWT contains one or more SlidePersistAtoms wich refer to
org.apache.poi.hslf.record.Notes.
If the 3rd SLWT is missing it means that the ppt does not contain notes.

 Example in XML notation:

 <SlideListWithText>
   <SlidePersistAtom>
     <psrReference>994</psrReference>  // always  org.apache.poi.hslf.record.Notes
     <slideId>316</slideId>
   </SlidePersistAtom>
   <SlidePersistAtom>
     <psrReference>995</psrReference>
     <slideId>317</slideId>
   </SlidePersistAtom>
 </SlideListWithText>

Regards, Yegor


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


Mime
View raw message