Bug 92916 - registerContextMenuInterceptor does not work when run in a macro on "Open Document"
Summary: registerContextMenuInterceptor does not work when run in a macro on "Open Doc...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.4.2.2 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2015-07-24 13:33 UTC by pierre-yves samyn
Modified: 2016-04-22 09:37 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
presence.ods (macro on open document) (17.48 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-07-24 13:33 UTC, pierre-yves samyn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pierre-yves samyn 2015-07-24 13:33:22 UTC
Created attachment 117419 [details]
presence.ods (macro on open document)

Hi

Description: registerContextMenuInterceptor does not work when run in a macro on "Open Document".

The presence.ods attached launches a procedure on "Open Document".
This procedure changes the context menu for the range C2:E8.

Launched manually *after* opening the document continues to function.
Associated with the event "Open Document" it no longer works.

The procedure is launched (verified by print statements and xray on objects) but the menu is not displayed.

Steps to reproduce:
1. Open the presence.ods attached
2. Accept macros if prompted
3. Right click somewhere in range C2:E8

Expected result: customized context menu
Actual result: standard context menu

This worked fine until version 4.3.4

4. Tools> Macros> Run macros> registerContextMenuInterceptor
5. Right click somewhere in range C2:E8

Expected & actual result: customized context menu

Also reproduced on:
- windows 7 & 4.4.2.2
- windows 7 & 4.4.4.3
- windows 7 & Version: 5.0.0.3 Build ID: f79b5ba13f5e6cbad23f8038060e556217e66632
Locale: fr-FR (fr_FR)

So I set status to New

May be related to bug 92770 ?

Regards
Pierre-Yves
Comment 1 Luke 2015-07-25 04:55:53 UTC
please don't confirm your own bugs.
Comment 2 pierre-yves samyn 2015-07-25 07:31:50 UTC
(In reply to Luke from comment #1)
> please don't confirm your own bugs.

As explained the bug was reproduced on different platforms by different people.
Please do not change the status again.
Comment 3 Olivier 2015-09-03 08:39:23 UTC
Hi,

I confirm this bug : registerContextMenuInterceptor does not work when run in a macro on "Open Document" since 4.4.2.
Comment 4 raal 2015-11-18 17:45:32 UTC
This seems to have begun at the below commit.
Adding Cc: to Stephan Bergmann ; Could you possibly take a look at this one?
Thanks 
 cc0baee6acfd3166332690fb25404fa440b76abc is the first bad commit
commit cc0baee6acfd3166332690fb25404fa440b76abc
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Sat Mar 14 20:38:34 2015 +0800

    source-hash-6b4c596b01039324cfe78f38c4e3ffb9080bcd34
    
    commit 6b4c596b01039324cfe78f38c4e3ffb9080bcd34
    Author:     Stephan Bergmann <sbergman@redhat.com>
    AuthorDate: Mon Jun 2 11:12:11 2014 +0200
    Commit:     Stephan Bergmann <sbergman@redhat.com>
    CommitDate: Mon Jun 2 11:12:11 2014 +0200
    
        Fix memory leak for BASIC sub (as well as void function)
    
        d88593af59d9126cdbcd6c0a5b06fb9c673dc6f9 "INTEGRATION: CWS ab34: #i73457#
        Prevent sub from beeing set as param 0 for return type void" to fix i#73457
        "Memory Leak in all Basic type void Method calls" had made the PutDirect call
        dependent on != SbxVOID only (which would cover void functions) but not also on
        != SbxEMPTY (which would apparently be required to also cover subs, as seen with
        CppunitTest_basic_vba run under lsan).  Either this was an oversight with the
        original fix, or subs have meanwhile changed from GetType() == SbxVOID to
        SbxEMPTY?
    
        Change-Id: I3e5dbf79bfd5eea3cfec8ed3fa984d13167aa501
Comment 5 Stephan Bergmann 2015-11-19 15:57:33 UTC
(In reply to raal from comment #4)
>     commit 6b4c596b01039324cfe78f38c4e3ffb9080bcd34
>     Author:     Stephan Bergmann <sbergman@redhat.com>
>     AuthorDate: Mon Jun 2 11:12:11 2014 +0200
>     Commit:     Stephan Bergmann <sbergman@redhat.com>
>     CommitDate: Mon Jun 2 11:12:11 2014 +0200
>     
>         Fix memory leak for BASIC sub (as well as void function)

That commit got reverted again to fix bug 92446 that it had caused, and the revert landed in LO 4.4.6 according to bug 92446 comment 9.

Can somebody please check whether this issue is fixed in LO 4.4.6?
Comment 6 Robinson Tryon (qubit) 2015-12-13 11:13:11 UTC
Migrating Whiteboard tags to Keywords: (bibisected)
[NinjaEdit]
Comment 7 pierre-yves samyn 2016-04-22 09:37:25 UTC
Hi

WORKSFORME on windows 7/64 &nd:

- Version: 5.1.2.2
Build ID: d3bf12ecb743fc0d20e0be0c58ca359301eb705f
Threads CPU : 2; Version de l'OS :Windows 6.1; UI Render : par défaut; 
Locale : fr-FR (fr_FR)
-Version: 5.2.0.0.alpha1 (x64)
Build ID: 902b28a39528b6c92602e9b521a1d0861be1caf9
Threads CPU : 2; Version de l'OS :Windows 6.1; UI Render : par défaut; 
Locale : fr-FR (fr_FR)

Thank you
Regards
Pierre-Yves