https://bugs.documentfoundation.org/show_bug.cgi?id=152266

            Bug ID: 152266
           Summary: A macro warning shows because of stale events
                    assignment, but no indication in UI for that
           Product: LibreOffice
           Version: 6.2.7.1 release
          Hardware: All
               URL: https://ask.libreoffice.org/t/macro-warning-shows-desp
                    ite-no-macros-contained-in-document/84634/5
                OS: All
            Status: UNCONFIRMED
          Keywords: bibisected, bisected, regression
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: mikekagan...@hotmail.com
                CC: caol...@redhat.com, ville...@t-online.de

Created attachment 183855
  --> https://bugs.documentfoundation.org/attachment.cgi?id=183855&action=edit
A sample file from ask.libeoffice.org

Since commit b3edf85e0fe6ca03dc26e1bf531be82193bc9627 ("warn on load when a
document binds an event to a macro", author Caolán McNamara, Aug 13 2019, for
v.6.4, backported to 6.3.1 and 6.2.7), some documents that likely had macros
assignment at some point, but then got the macros removed, started to show the
"The document contains document macros" warning. But there is no indication in
the UI about such a binding; saving the file keeps the binding, and so doesn't
help user getting rid of the warning. Only opening the event assignment dialog,
selecting the correct entry there (which doesn't show any assignment!), and
pressing [Remove] button (and then saving) gets rid of that stale assignment -
but that is impossible for a user to guess that this incantation would do the
magic.

The attachment is from
https://ask.libreoffice.org/t/macro-warning-shows-despite-no-macros-contained-in-document/84634/5,
which says this:

> The OpenOffice default template I used to use several years included 21 empty
> event declarations. All documents derived from that template raise a macro
> warning in recent versions of LibreOffice although nothing points to any 
> macro.
> Sample file ... and hundreds more attachments on forum.openoffice.org having a
> content.xml starting like this:
> 
> <office:document-content office:version="1.2">
> <office:scripts>
>     <office:event-listeners>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:start-app"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:close-app"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:new"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:load-finished"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="dom:load"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:prepare-unload"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="dom:unload"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:save"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:save-done"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:save-as"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:save-as-done"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:copy-to"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:copy-to-done"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="dom:DOMFocusIn"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="dom:DOMFocusOut"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:print"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:view-created"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:prepare-view-closing"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:view-close"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:modify-changed"/>
>         <script:event-listener script:language="ooo:script" 
> script:event-name="office:visarea-changed"/>
>     </office:event-listeners>
> </office:scripts>

Opening the file, Tools->Customize->Events, and going through the event list,
pressing [Remove] for each, helps getting rid of the problem.

I don't know how to create such a file from scratch.
Either this is a false positive (and this markup should be considered as no
assignment, maybe even clearing the entries on round-trip), or there should be
some indication in the events assignment UI, which would help the user.

Additionally it would be nice if the warning would be a bit more specific where
to search, but that's indeed a different issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to