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


On Thu, Apr 04, 2013 at 11:08:54AM +0200, Jan Holesovsky wrote:
mcmurchy1917-libreoffice@yahoo.co.uk píše v St 27. 03. 2013 v 09:46
+0000:

I've fallen foul of this bug in recent days so have decided to have a
look at it to see if I can provide a patch.

Thank you for the offer of help! :-) (...) I'm CCing Noel and Lionel
- macros are Noel's area, and databases Lionel's; (...)

In the bug report it was confirmed that a macro assigned to either the
Before Unloading or When Unloading events of a dataform are not called
when the form document is closed.

However, when editing a form and the "Design Mode" option is
toggled the events are called. Also the events when the form is
loaded are called under all circumstances.

I don't have a code pointer ready to give you, but:

1) I've indeed noticed that when opening a form in design mode (that
   is, "edit" instead of "open"), the "open" event is called; I've
   always found that rather curious, but have never gone through the
   time to make a complete bug report of it.

   Since you are going to touch that area anyway, it may make sense to
   conditionalise these events to "non-design mode". Actually, my
   first thought is that *all* events should be disabled in design
   mode, but I'm willing to listen to arguments otherwise.

2) Since you say that in design mode the events fire, my expectation /
   hope would be that somewhere there is code that does:

   if (isInDesignMode)
       fireCloseEvent();

   Possibly that is just a "forgotten" negation there; it would make
   sense to see the git history that put that condition to see its
   rationale, and if it turns out it is as I think, just add the
   negation.

   (Or maybe the code is something like:

   if (!isInDesignMode)
       return false;

   fireCloseEvent();

   and then we have to *remove* the negation)

   Too see where that code is, I'd suggest to run libreoffice in gdb,
   break on the event being called and then look at the backtrace. To
   break on the event, you can bind a macro that does:
    MessageBosx "Even Called!"
   cause the event to be fired (in design mode, thus) and when you get
   the dialog, just press CTRL-C in gdb.

-- 
Lionel

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.