Bug 103113 - IDE: JavaScript macros is not removed purely from Spreadsheet
Summary: IDE: JavaScript macros is not removed purely from Spreadsheet
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro-Javascript
  Show dependency treegraph
 
Reported: 2016-10-11 14:00 UTC by nvyush
Modified: 2023-09-20 03:05 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
The files before and after deleting of macros (27.84 KB, application/x-zip-compressed)
2016-10-25 09:17 UTC, nvyush
Details
Delete disabled in before deleting macro (24.18 KB, image/png)
2019-05-14 05:21 UTC, Andreas Heinisch
Details
Created macro beanshell (23.21 KB, image/png)
2019-05-14 08:32 UTC, Andreas Heinisch
Details
Delete created macro (27.85 KB, image/png)
2019-05-14 08:33 UTC, Andreas Heinisch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nvyush 2016-10-11 14:00:57 UTC
I created some JavaScript macro for a Calc spreadsheet. Then I copied its code to the My Macros and removed the macro from the spreadsheet. Now when I open the spreadsheet I see the warning:

"This document contains macros.
Macros may contain viruses. Execution of macros is disabled due to the current macro security setting in Tools - Options - LibreOffice - Security.
Therefore, some functionality may not be available."

I unziped the spreadsheet and found an empty folder "Scripts/javascript". Also I found this lines at the META-INF/manifest.xml file:
<manifest:file-entry manifest:full-path="Scripts/javascript/" manifest:media-type="application/binary"/>
<manifest:file-entry manifest:full-path="Scripts/" manifest:media-type="application/binary"/>

I suppose that the JavaScript Macros manager must remove an empty "Scripts/javascript" folder and its description from the manifest.
Comment 1 Buovjaga 2016-10-24 12:28:22 UTC
Plz attach an example document.

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the document.
Comment 2 Buovjaga 2016-10-24 12:28:57 UTC
(In reply to Buovjaga from comment #1)
> Plz attach an example document.

And I mean a document, where you have not yet removed the JS macro.
Comment 3 nvyush 2016-10-25 09:17:14 UTC
Created attachment 128238 [details]
The files before and after deleting of macros

(In reply to Buovjaga from comment #2)
> (In reply to Buovjaga from comment #1)
> > Plz attach an example document.
> 
> And I mean a document, where you have not yet removed the JS macro.

The same bug for BeanShell macros.

Steps to reproduce the issue for JavaScript macros:
1. Create a new LibreOffce Calc document.
2. Create a JavaScript macro (menu Tools - Macros - Organise Macros - JavaScript..., then select the document 'Untitled 1', Create - 'Library1' - OK, Create - 'Macro1' - OK).
3. Save the document as 'before_deleting_javascript_macro.ods'.
4. Close the document.
5. Open the document - get the warning 'This document contains macros...' - OK.
6. Delete the JavaScript macro (menu Tools - Macros - Organise Macros - JavaScript..., then select 'before_deleting_javascript_macro.ods' - 'Library1' - 'Macro1.js', Delete - Yes, Delete - Yes).
7. Save the document as 'after_deleting_javascript_macro.ods'.
8. Close the document.
9. Open the document - get the warning 'This document contains macros...' - WHY? We has deleted the macros.
Comment 4 Buovjaga 2016-11-01 10:56:14 UTC
(In reply to nvyush from comment #3)
> Created attachment 128238 [details]
> The files before and after deleting of macros
> 
> (In reply to Buovjaga from comment #2)
> > (In reply to Buovjaga from comment #1)
> > > Plz attach an example document.
> > 
> > And I mean a document, where you have not yet removed the JS macro.
> 
> The same bug for BeanShell macros.
> 
> Steps to reproduce the issue for JavaScript macros:
> 1. Create a new LibreOffce Calc document.
> 2. Create a JavaScript macro (menu Tools - Macros - Organise Macros -
> JavaScript..., then select the document 'Untitled 1', Create - 'Library1' -
> OK, Create - 'Macro1' - OK).
> 3. Save the document as 'before_deleting_javascript_macro.ods'.
> 4. Close the document.
> 5. Open the document - get the warning 'This document contains macros...' -
> OK.
> 6. Delete the JavaScript macro (menu Tools - Macros - Organise Macros -
> JavaScript..., then select 'before_deleting_javascript_macro.ods' -
> 'Library1' - 'Macro1.js', Delete - Yes, Delete - Yes).
> 7. Save the document as 'after_deleting_javascript_macro.ods'.
> 8. Close the document.
> 9. Open the document - get the warning 'This document contains macros...' -
> WHY? We has deleted the macros.

Reproduced with document.

Win 7 Pro 64-bit Version: 5.3.0.0.alpha1+
Build ID: 4b4abb73fcd7f2802e73102b3e7c30face8d309c
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; Layout Engine: old; 
TinderBox: Win-x86@39, Branch:master, Time: 2016-10-31_02:54:50
Locale: fi-FI (fi_FI); Calc: group

LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 5 QA Administrators 2017-11-02 08:44:25 UTC Comment hidden (obsolete)
Comment 6 nvyush 2019-02-11 12:22:22 UTC
The bug is still present for both JavaScript and BeanShell macros. 

Version: 6.0.7.3 (x64)
Build ID: dc89aa7a9eabfd848af146d5086077aeed2ae4a5
CPU threads: 8; OS: Windows 10.0; UI render: default; 
Locale: ru-RU (ru_RU); Calc: group
Comment 7 Andreas Heinisch 2019-05-14 05:21:25 UTC
Created attachment 151382 [details]
Delete disabled in before deleting macro

Shouldn't it be possible to delete it from here? Atm all the buttons are disabled and therefore I can't delete the macro.
Comment 8 Buovjaga 2019-05-14 06:35:57 UTC
(In reply to Andreas Heinisch from comment #7)
> Created attachment 151382 [details]
> Delete disabled in before deleting macro
> 
> Shouldn't it be possible to delete it from here? Atm all the buttons are
> disabled and therefore I can't delete the macro.

Well, you don't have any macros visible (you need to click the + button to expand), but I would expect the Create button to be active even here.
Comment 9 Andreas Heinisch 2019-05-14 08:32:47 UTC
Created attachment 151385 [details]
Created macro beanshell

Create a sample macro in beanshell
Comment 10 Andreas Heinisch 2019-05-14 08:33:27 UTC
Created attachment 151386 [details]
Delete created macro

Error message during deletion of the macro
Comment 11 Andreas Heinisch 2019-05-14 08:35:49 UTC
So in the previous screenshots I have created a sample beanshell macro. Then I try to delete it. First, the deletion fails, second, if I try to delete the single tree elements it succeeds, but after I close and reopen the document, they are still there.

I think LO should just remove the "before.ods" macro in this case?
Comment 12 Buovjaga 2019-05-20 07:02:15 UTC
Please don't change the status to needinfo as it is not correct: https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Status/NEEDINFO
Comment 13 Samuel Mehrbrodt (allotropia) 2019-05-20 10:01:36 UTC
(In reply to Andreas Heinisch from comment #11)
> So in the previous screenshots I have created a sample beanshell macro. Then
> I try to delete it. First, the deletion fails, second, if I try to delete
> the single tree elements it succeeds, but after I close and reopen the
> document, they are still there.
> 
> I think LO should just remove the "before.ods" macro in this case?

Can you write a different bug for that? This one is about javascript macros.
Comment 14 Buovjaga 2019-05-20 10:02:44 UTC
(In reply to Samuel Mehrbrodt (CIB) from comment #13)
> (In reply to Andreas Heinisch from comment #11)
> > So in the previous screenshots I have created a sample beanshell macro. Then
> > I try to delete it. First, the deletion fails, second, if I try to delete
> > the single tree elements it succeeds, but after I close and reopen the
> > document, they are still there.
> > 
> > I think LO should just remove the "before.ods" macro in this case?
> 
> Can you write a different bug for that? This one is about javascript macros.

Adding Andreas to CC
Comment 15 Andreas Heinisch 2019-07-31 11:47:23 UTC
I tried to investigate this error and If you try to delete a Javascript macro LO throws the following exception at https://opengrok.libreoffice.org/xref/core/cui/source/dialogs/scriptdlg.cxx?r=45839115#964

L"Function Deletable not supported.\njava stack trace:\ncom.sun.star.lang.IllegalArgumentException: Function Deletable not supported.\r\n\t at com.sun.star.script.framework.browse.ProviderBrowseNode.invoke(ProviderBrowseNode.java:238)\r\n\t at com.sun.star.script.framework.provider.ScriptProvider.invoke(ScriptProvider.java:429)\r\n"
Comment 16 QA Administrators 2021-09-19 03:42:57 UTC Comment hidden (obsolete)
Comment 17 QA Administrators 2023-09-20 03:05:55 UTC
Dear nvyush,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug