[Libreoffice] Suggestion needed for External Edit functionality.

surenspost at gmail.com surenspost at gmail.com
Wed Nov 10 08:42:07 PST 2010

Hi Everyone,

This is regarding this bug - https://bugs.freedesktop.org/show_bug.cgi?id=30508

Goal: To be able to open an image(Graphic item) in an external
application for advanced editing
What is already done: Added a menu item to right click popup on the
graphic, coupled the menu item with a method that handles the event.(I
have attached a snippet of that method as a preliminary hack for the

I current way I am implementing is that I save the Graphic a temporary
file,then to create a new thread ( using osl_createThread from
osl/thread.h ) and from within the new thread execute the external
application to open the temp ( using osl_executeProcess from
osl/process.h). Then on I poll for the exit of the process and after
exit, exit the new thread and main thread updates the graphic with the
new temporary image. But the current way blocks the main loop and I
end up getting an unresponsive libreoffice window which is not
desirable at all.

Please advice me how to go about this further. I thought off
interrupts but not really sure to proceed. I searched opengrok for
interrupt but couldn't find anything helpful.
If I have been doing it the wrong way altogether please suggest me how
to proceed.

Please bear with the varied string classes used in the snippet, will
fix them all before submitting the patch. Also Currently I am
implementing this in Gnome ( just using eog as the external command),
but will give the user the option to choose the application with a
file chooser dialog.

Many thanks for Thorsten and many others so far who have helped to get
me this far.

Learning < Doing
Learn By doing.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snippet.cpp
Type: application/octet-stream
Size: 2999 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20101110/85446a0b/attachment.obj>

More information about the LibreOffice mailing list