On 28.03.2015 21:52, Piet van Oostrum wrote:
Piet van Oostrum wrote:
> I am currently experimenting with programming LibreOffice through Python/UNO.
> One thing I tried is to create a document, not with the
> loadComponentFromURL call from the desktop, but the route via the
> XLoadable interface,
[snip]
> Now when I do this with a Writer document:
>
> textdoc = smgr.createInstanceWithContext("com.sun.star.text.TextDocument", context)
>
> LibreOffice crashes with a segmentation fault.
this is not a supported way to create a document: it will only create
the document model but no view or controller for it. there is probably
some bug where a pointer is null and dereferenced, but if it didn't
crash it still wouldn't work because some APIs require that there is a view.
I just came across this piece of prose:
A few old-style services need special treatment. For example, you
cannot ask the service manager to create an instance of a
com.sun.star.text.TextDocument. You must load it using the method
loadComponentFromUrl() at the desktop's
com.sun.star.frame.XComponentLoader interface.
https://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Understanding_the_API_Reference
I guess that explains it. Although I think crashing is a bit harsh :)
Context
- Re: LibreOffice 4 and Python on Yosemite (continued)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.