Hi Jermeny,

this mailing list needs subscription and you are currently not subscribed. Otherwise you won't get any reply on your questions directly.

You can subscribe under http://api.openoffice.org/servlets/ProjectMailingListList


Now to your problem. The easiest way to reproduce it is when you create a small demo that reproduces the problem and submit an issue.


Thanks


Juergen

On 3/30/10 11:06 PM, Jeremy Trudel wrote:
I am trying to generate a powerpoint presentation, see code snippet:



public static void convert(XComponent xComponent, XComponentContext context,
String targetFilename, String conversionFilter)

{

         // How to get the XComponent, see
../Office/Office.OpenDocumentFromURL.snip

         XStorable xStorable = (XStorable)

         UnoRuntime.queryInterface(XStorable.class, xComponent);



         // Set properties for conversions

         PropertyValue[] conversionProperties = new PropertyValue[2];



         conversionProperties[0] = new PropertyValue();

         conversionProperties[0].Name = "Overwrite";

         conversionProperties[0].Value = new Boolean(true);



         conversionProperties[1] = new PropertyValue();

         conversionProperties[1].Name = "FilterName";

         conversionProperties[1].Value = conversionFilter;



         // Convert

         try {

             xStorable.storeToURL(createUNOFileURL(targetFilename, context),
conversionProperties);

         }

         catch (com.sun.star.io.IOException ex) {

             jL.warning("Error occured during conversion");

             ex.printStackTrace();

         }



     }





The problem I am having is a weird one. I am generating all kinds of
different slides (title slide, bullet slides, table slides, image slides).

Everything works great if I don't generate any image slides. I can generate
many presentations without a problem. The soffice.bin start and shuts down
gracefully, but if I try and generate an image slide the soffice.bin crashes
in an unreliable fashion. Sometimes it works and sometimes it crashes. I'm
not really sure what to do because I generate the same presentation over and
over again with the exact same parameters, but again soffice.bin crashes
sometimes, and sometimes it doesn't.



Are there any known issues with adding images to slides? This is the code
that I am using to add the image to the slide:



for (int j = 0; j<  xNewPage.getCount(); j++) {

                 Object oo = xNewPage.getByIndex(j);

                 XShape xShape = (XShape)
UnoRuntime.queryInterface(XShape.class, oo);

                 String type = xShape.getShapeType();

                 XText xText = (XText) UnoRuntime.queryInterface(XText.class,
xShape);

                 if (xText != null) {

                     if
(type.equals("com.sun.star.presentation.TitleTextShape")) {

                         xText.setString(jTitle);

                     } else if
(type.equals("com.sun.star.presentation.OutlinerShape")) {

                         String bullets = "";

                         for (String bullet : jBulletList) {

                             bullets += bullet + "\n";

                         }

                         xText.setString(bullets);

                     } else if
(type.equals("com.sun.star.drawing.GraphicObjectShape")) {

                         XPropertySet xPropertySet = (XPropertySet)
UnoRuntime.queryInterface(

                                 XPropertySet.class, xShape);

                         xPropertySet.setPropertyValue("GraphicURL",
Util.createUNOFileURL(

                                 jImagePath,

                                 context));

                     }

                 }

             }



Any help would be much appreciated.








--
Sun Microsystems GmbH        Juergen Schmidt
Nagelsweg 55                 Technical Lead Programmability
20097 Hamburg, Germany

Sitz der Gesellschaft:
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht München: HRB 161028
Geschäftsführer: Thomas Schröder

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to