Launching a web browser using the PYUNO bindings
Michael Stahl
mstahl at redhat.com
Tue Apr 16 04:45:53 PDT 2013
On 15/04/13 15:47, Javier Fernandez wrote:
> Hi,
>
> I'm trying to launch the default web browser to load an html file with
> the preview of the web wizard results.
>
> Im trying to get a dispatcher using the following code:
>
> xDispatch = xFrame.queryDispatch(oURL, "_top", ALL)
>
> Being oURL:
>
> (com.sun.star.util.URL){ Complete = (string)".uno:OpenHyperlink", Main =
> (string)"", Protocol = (string)"", User = (string)"", Password =
> (string)"", Server = (string)"", Port = (short)0x0, Path = (string)"",
> Name = (string)"", Arguments = (string)"", Mark = (string)"" }
>
> The xFrame instance is acquired as follows:
>
> xDesktop = xMSF.createInstance( "com.sun.star.frame.Desktop")
> xFrame = xDesktop.findFrame("_blank", 0)
>
> I've got several browsers installed in my environment (Ubuntu Quantal)
> and it works fine using the java version of the web wizard.
>
> Any idea why I'm getting always NULL as result of the queryDispatch call ?
that rather sounds like a bug if the same thing works from Java.
probably best to debug from C++ the implementation of queryDispatch, if
the parameters look as expected from the C++ side.
but i'm not sure how this dispatch stuff works, i guess most likely
you're calling one of these:
sfx2/source/view/sfxbasecontroller.cxx:Reference< frame::XDispatch >
SAL_CALL SfxBaseController::queryDispatch
framework/source/services/desktop.cxx:css::uno::Reference<
css::frame::XDispatch > SAL_CALL Desktop::queryDispatch
framework/source/dispatch/dispatchprovider.cxx:css::uno::Reference<
css::frame::
XDispatch > SAL_CALL DispatchProvider::queryDispatch
More information about the LibreOffice
mailing list