You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Constantin Volozhin <cv...@pragmaticsoft.com> on 2008/09/19 14:11:50 UTC
Re: getShapes() and Table
Thanks a lot, it works now. But related bug there (trunk code):
the code snippet:
SlideShow ppt = new SlideShow();
Slide slide = ppt.createSlide();
slide.addShape(new Table(1, 5));
Shape[] shapes = slide.getShapes();
brings following error on getShapes():
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at org.apache.poi.hslf.model.Table.initTable(Table.java:180)
at org.apache.poi.hslf.model.Table.setSheet(Table.java:193)
at org.apache.poi.hslf.model.Sheet.getShapes(Sheet.java:229)
at JustPOI.main(JustPOI.java:116)
Brings error only if table has only 1 row. Could you fix please also?
Thanks for you work!
> Fixed in r690262.
>
> Yegor
>
> > getShapes() code brings exception. Looks like bug. (trunk code used)
> >
> >
> > Exception in thread "main" java.lang.ClassCastException:
> > org.apache.poi.ddf.EscherOptRecord cannot be cast to
> > org.apache.poi.ddf.UnknownEscherRecord
> > at
> > org.apache.poi.hslf.model.ShapeFactory.createShapeGroup(ShapeFactory.java:48)
> > at
> > org.apache.poi.hslf.model.ShapeFactory.createShape(ShapeFactory.java:39)
> > at org.apache.poi.hslf.model.Sheet.getShapes(Sheet.java:228)
> > at JustPOI.main(JustPOI.java:29)
> >
> >
> > Code snippet to test:
> >
> > SlideShow ppt = new SlideShow();
> > Slide slide = null;
> >
> > try {
> > slide = ppt.createSlide();
> > } catch (IOException e1) {
> > e1.printStackTrace();
> > }
> >
> > slide.addShape(new Table(2, 5));
> >
> > Shape[] shapes = slide.getShapes();
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> > For additional commands, e-mail: user-help@poi.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org