Egon wrote: > Thanks everybody. > I have resolved the problem with the absolute position > of a text in a SXW ( by the getPosition method of a > viewCursor). > In this time, I have to write here because I have > found a problem with the debugger: > I have a Macro OO ( VB Office ) , when I execute it by > the step by step method of the debugger ( doing clicks > in the debugger ) I get the correct result, but when I > call this macro by the commandline ( soffice > "macro://..." ) I get an incorrect result. > I do not know if this behaviour is a soffice bug or an > error into the macro ( I think that if the macro runs > correctly in step-by-step mode, it will be correct in > the commandline execution). > > Can anyone tell me about this behaviour ? > I use the 1.1.4 version of soffice.
I assume that you stumbled over something I would call a bug, either in the API implementation or in your macro. Here's the possible explanation: You made an API call that doesn't update everything in the document when executed but instead posts a user event to do the updates later. One of the missing and postponed updates obviously prevents your next API call from working and so your macro fails. If this was a documented part of this API call you should take this into account in your macro, if not, it would be a bug in the API implementation. From my experience it's mostly the latter (IMHO postponed updates should be very limited exceptions) but it needs clarification. So why does it work in the debugger? OOo Basic allows some background processing by granting execution of events that wait for execution after a certain number of processed statements. This allows to execute paint events, but also user events. Obviously the time between the two calls is not big enough in your macro so now background processing happens before the failing call is executed. Another reason could be that the API call doesn't post a user event but postpones the update until execution of the next idle handler and while basic is running the idle handler never gets control. In case you step through your code or set a breakpoint in the right place, in both cases (user event or idle handler) the background processing happens in time and your macro succeeds. Best regards, Mathias -- Mathias Bauer - OpenOffice.org Application Framework Project Lead Please reply to the list only, [EMAIL PROTECTED] is a spam sink. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
