Hi Zhang Xiaofei,

a) getCurrentFrame() isnt a good choice anyway. It depends from focus
and even if your job was called it can happen that the focus was switched to another resource already.

b) Solution: Make it more explicit. Every job will be called wit a set of parameters of type css.beans.NamedValue. If you read the developers guide you will find a detailed description which parameters exists for which job-use-case. E.g. for document events like OnFocus you will find the model already part of these parameter set ... and so there is no need to use the destkop or any frame.

Regards
Andreas

Hi Carsten and all,

A colleague of mine who develops extensions, met a problem he cannot explain. And I'd like to ask for help on his behalf.

As in the source file in attachment, he was trying to implement a ::com::sun::star::task::Job component and make it respond to OnFocus event, when the current document is activated. In a case where user switches from an OOo window A to another OOo window B, OnFocus should call com.sun.star.task.XJob:execute(). However, he found that the XFrame returned by xDesktop->getCurrentFrame() (Line 186) seems to be the frame of A's rather than B's as he expected. He would like to know if this is a right behavior of OOo and the solution to achieve his goal.

Could you please help to check his code and share your suggestions?

Thanks and Best Regards,
Felix.


------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to