Issue 45184

Summary: cannot execute macros in embedded form documents
Product: Base Reporter: Frank Schönheit <frank.schoenheit>
Component: codeAssignee: mikhail.voytenko
Status: CLOSED FIXED QA Contact: issues@dba <issues>
Severity: Trivial    
Priority: P3 CC: issues, kai.sommerfeld, kamataki
Version: 680m86   
Target Milestone: OOo 2.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
document to reproduce the bug case none

Description Frank Schönheit 2005-03-16 13:54:59 UTC
- open the attached biblio.odb
- double-click the "macro test" form to open it
- press the button in the form
=> error message: "... BasicProviderImpl::getScript: no script!"
Comment 1 Frank Schönheit 2005-03-16 13:55:55 UTC
Created attachment 23896 [details]
document to reproduce the bug case
Comment 2 Frank Schönheit 2005-03-16 13:56:58 UTC
correction: executing the macro works exactly once after opening the document.
Then, you have to close and re-start OOo to make it work again.
Comment 3 Frank Schönheit 2005-03-16 14:00:24 UTC
more precise :-\ :
- open the form
- press the button
=> macro is executed
- close the form
- open the form
- press the button
=> macro is not executed
Comment 4 Frank Schönheit 2005-03-16 14:02:56 UTC
accepting
Comment 5 Frank Schönheit 2005-03-16 14:34:25 UTC
fs->mba: It seems the SfxBaseModel does not notify an OnLoad event. Thus the
OfficeDocumentsManager (a helper implementation by KSO which tracks open
documents) does not know about the document, and thus cannot find scripts therein.

Note that this bug renders scripting in Base effectively useless, which is a
heavy restriction :(
Comment 6 Mathias_Bauer 2005-03-16 17:01:42 UTC
This should be a duplicate to #i43920#. The CWS is currently in QA, but you can
verify if the fix works here also.
Comment 7 Mathias_Bauer 2005-03-16 17:02:33 UTC
.

*** This issue has been marked as a duplicate of 43920 ***
Comment 8 Frank Schönheit 2005-03-17 08:04:11 UTC
no it isn't - it still happens in CWS fwkfinal1
Comment 9 Frank Schönheit 2005-03-17 08:04:57 UTC
fs->mba: The windows version of fwkfinal1 still shows the problem
Comment 10 Mathias_Bauer 2005-03-17 08:58:33 UTC
Mikhail, the bug now has changed: the events are sent properly, but if you open
the form a second time and click on the button, the tdoc UCP complains about
wrong storage and on closing the document the tdoc UCP still complains about
getting an OnUnload for an unknown document.

Please note that in CWS fwkfinal1 the tdoc UCP has been changed to listen for
the "new" events "OnCreate" and "OnLoadFinished" instead of "OnNew" and "OnLoad".
Comment 11 mikhail.voytenko 2005-03-18 08:33:37 UTC
The problem was that the FinishedLoading message was sent before the document
was registered in global broadcaster.

The scenario worked for the first time just because tdoc ucp library is loaded
on demand, in this case it was loaded during pressing to the button, after that
it used a different mechanics to detect already opened documents. The second
time the tdoc ucp is already loaded and expects all the new documents to send
the FinishedLoading notification that didn't happen.

The fix is integrated into fwkfinal2 cws, unfortunately it can not be checked
there, and integration of the fix after fwkfinal1 is in master might be too late. 
Comment 12 mikhail.voytenko 2005-03-18 11:16:41 UTC
So I set the bug to fixed.
Comment 13 mikhail.voytenko 2005-03-18 11:17:41 UTC
No possibility to verify before integration into the master. So it is handled as
a development bug.
Comment 14 Frank Schönheit 2005-03-30 06:31:34 UTC
looks good in m89, at least with respect to executing the macro multiple times.
Submitted issue 46262 for the zillions of assertion which are now raised once
the macro has been run once.
Comment 15 misterdee 2007-09-27 12:26:52 UTC
This issue seems to have occurred on my Fedora 7 box with OOo2.3 (upgraded from
the 2.2 as shipped with the distro).  Can confirm that the biblio db test fails.
Comment 16 rdbilbrey 2007-11-02 20:32:27 UTC
I am using OO 2.3 upgraded from 2.1 
If I open a form and use it then I can edit the button and assign the macro.
Then it will work until OO Base is restarted and is then broken again. I have 1
form with hundreds of scripts and macros assigned to 79 buttons so this is a
major problem for me and our hospital.
Comment 17 Frank Schönheit 2007-11-02 21:11:43 UTC
Seems this issue crept in into 2.3 after it had been fixed for 2.0 already. It
had been re-submitted as issue 81217, and will be fixed for 2.4.