Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


One irritating thing I found out:
Although the listener is called with "onLayoutFinished" the desktop still doesn't have an
ActiveFrame. It seemes to be set afterwards.

When I create a component enumeration, I can see the upcoming component, but it isn't set yet.

Any ideas, how to receive an event after it is set?






Am 31.05.2015 um 12:21 schrieb X Roemer:
sorry, forgot some code in the listener.m it should be:



class Doc_Event_Listener(unohelper.Base,XDocumentEventListener):

    def documentEventOccured(self,ev):

        if ev.EventName == 'OnLayoutFinished':
            if document.Name == '':
                document.Name = 'xxx'

                URL="private:factory/swriter"
desktop.ActiveFrame.loadComponentFromURL(URL,'_top','',())





Am 31.05.2015 um 12:18 schrieb X Roemer:
Hi,

this post is somehow related to "open files automatically", but a bit more specific. http://nabble.documentfoundation.org/open-files-automatically-td4149584.html


When I load a component in an already loaded LO, following code works inside an extension:
URL="private:factory/swriter"
desktop.ActiveFrame.loadComponentFromURL(URL,'_top','',())

But when I try to do that on startup of LO, LO crashes.
I used an EventBroadcaster to start the code, like this:

eventb = ctx.getByName("/singletons/com.sun.star.frame.theGlobalEventBroadcaster")
eventb.addDocumentEventListener(listener)

and in the listener:

class Doc_Event_Listener(unohelper.Base,XDocumentEventListener):

    def documentEventOccured(self,ev):

        if document.Name == '':
            document.Name = 'xxx'

            URL="private:factory/swriter"
desktop.ActiveFrame.loadComponentFromURL(URL,'_top','',())


It doesn't matter if I set _self or _top or _parent, LO always crashes. Whereas when I use _blank or _default, it works, but the document gets opened in another window, what is not, what I want to reach.

I tried it on OO also, slightly different with a TopWindowListener, and it works.

Does anybody have an idea about what is going on and if it is solveable in another way?

Regards,
Xaver





--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


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.