jakarta-oro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin van den Bemt <mll...@mvdb.net>
Subject Re: About the bug in SlideShow class
Date Fri, 02 Feb 2007 08:44:10 GMT
Hmm better send this to poi-user@jakarta.apache.org, don't think you will get a valuable response
on
the oro list..

Mvgr,
Martin

Mingfan.Lu wrote:
> When I use the POI-HLSF to extract the text from the slides.
> My code is very easy:
>   PowerPointExtractor ppe = new PowerPointExtractor("c:\\4.ppt");
>   String s = ppe.getText(true,true);
>   System.out.println(s);
>   ppe.close();
> 
> But there is a error:
>   java.lang.ClassCastException: org.apache.poi.hslf.record.Slide cannot be
> cast to org.apache.poi.hslf.record.MainMaster
> I trace the bug, I find that:
>   For the ppt which has more than 2(include 2) MainMasters, the SlideShow
> Constructor could not correctly to get MasterRecords:
> 
> 
> SlideListWithText masterSLWT =
> _documentRecord.getMasterSlideListWithText();
> SlideListWithText slidesSLWT = _documentRecord.getSlideSlideListWithText();
> SlideListWithText notesSLWT  = _documentRecord.getNotesSlideListWithText();
> 
>    //find master slides
>    SlideAtomsSet[] masterSets = new SlideAtomsSet[0];
>    org.apache.poi.hslf.record.MainMaster[] masterRecords = null;
>    if (masterSLWT != null){
> 
>        masterSets = masterSLWT.getSlideAtomsSets();
>        masterRecords = new org.apache.poi.hslf.record.MainMaster[
> masterSets.length];
>        for(int i=0; i<masterRecords.length; i++) {
>            masterRecords[i] = (org.apache.poi.hslf.record.MainMaster
> )getCoreRecordForSAS(masterSets[i]);
>        }
>    }
> 
> Eg. The masterSets.length =2, but there is only 1 master records in the
> MostRecentCoreRecords, so the there will be a casting error.
> 
> And I also find that the test data given in the Src dir, all ppt file are
> simple, all of them have only 1 master slide,
> 
> Did anyone test the ones which have more than 2 master slides?

---------------------------------------------------------------------
To unsubscribe, e-mail: oro-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: oro-dev-help@jakarta.apache.org


Mime
View raw message