Cannot use GraphicExportFilter from external python script (crash)
tvi
thomas at thomasvial.fr
Sun May 4 07:28:16 PDT 2014
Hi,
I'm trying to render slides from a PowerPoint presentation using a
GraphicExportFilter, from a python script. However I'm experimenting crashes
at various levels. My investigations have led me to the internals of LO
hence the posting to the Dev list. I first tried the Users list, but was
advised to try here instead -- sorry if you read it twice.
I'm using LibreOffice 4.0.4 from CentOS repositories.
You can download the script from here
<https://drive.google.com/file/d/0By-h0KPo01P2TF9XMGVTQmY0QU0/edit?usp=sharing>
, and the test presentation from here
<https://drive.google.com/file/d/0By-h0KPo01P2WGJJWnFzdy1CQXM/edit?usp=sharing>
.
Here is the outline of my python script:
And the server invocation:
As such, the script segfaults when calling exporter.setSourceDocument().
With a little bit of debugging, I could track it down to a global
pImplSVData pointer being unitialized when instantiating a SolarMutexGuard.
This is easily worked around by wrapping a call to InitVCL() in a small
python module.
*First question:* is the segfault normal, and is my workaround relevant? I'm
wondering if running in non interactive mode has something to do with the
unitialized Application/VCL stuff.
Even with the workaround, I get an IllegalArgumentException in
setSourceDocument(). With more debugging, it appears the culprits are the
following lines in UnoGraphicsExporter.cxx:
Strangely, the function correctly identifies the page object as a XDrawPage
(mxPage != NULL). However the SvxDrawPage assumption, which I don't
understand, does not hold (mpUnoPage == NULL), so the break statement is
triggered.
Hence *second question*: am I correctly passing the page object around? I
have tried passing the XShapes interface instead, without more luck.
Many thanks in advance.
The fact that I had to dig into the runtime with a debugger makes me think
that I have missed something obvious. But what is it?
Thomas
--
View this message in context: http://nabble.documentfoundation.org/Cannot-use-GraphicExportFilter-from-external-python-script-crash-tp4107539.html
Sent from the Dev mailing list archive at Nabble.com.
More information about the LibreOffice
mailing list