Bug 67116 - Macros: RemoveByName with IDE Code Window open cause program flow termination
Summary: Macros: RemoveByName with IDE Code Window open cause program flow termination
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks: Macro-UI
  Show dependency treegraph
 
Reported: 2013-07-20 10:09 UTC by irs
Modified: 2023-09-20 03:06 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
The attached Writer ODT file contains code that demonstrates the problem. (33.87 KB, application/vnd.oasis.opendocument.text)
2013-07-20 10:09 UTC, irs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description irs 2013-07-20 10:09:04 UTC
Created attachment 82724 [details]
The attached Writer ODT file contains code that demonstrates the problem.

Problem description: 

The method “removeByName()” from the interface “com.sun.star.container.XNameContainer” removes the specified element (module) from the BasicLibraries(“Standard”) correctly. 

However a scenario can exist in which the program exits the subroutine immediately after executing the line of code that contains the “removeByName()” method. When this occurs no error messages are reported.

To create the problem scenario, then the BASIC IDE Code Window must be open, and it must be displaying a module from the document containing the removeByName line of code. 

Once the problem scenario has occurred, then it is necessary to close this document and re-launch it to clear the problem.

Steps to reproduce:
1. Create a BASIC module named "Module2" 
2. In Module1 create a subroutine as follows:

sub Main
	BasicLibraries.getByName("Standard").removeByName("Module2")
	Msgbox "Success: Module2 removed. Bug not observed."
end sub

3. Start execution of the above subroutine from the BASIC IDE Code Window

4. The Msgbox success message does not get executed.

5. The attached Writer ODT file has sample code that can better demonstrate the problem scenario.

Current behavior:
With the BASIC Code Window displaying a module from the program that executes a removeByName() line, then the program flow terminates.

Expected behavior:
With the BASIC Code Window displaying a module from the program that executes a removeByName() line, then the program flow will continue and the subsequent lines of code will be executed.

regards, ian.
              
Operating System: All
Version: 3.3 all versions
Comment 1 irs 2013-07-20 11:38:47 UTC
This problem may be related to: Bug 67118 - BASIC: ReplaceByName - the IDE Code Window does not display the replacement

Note: I was able to observe this problem with LibreOffice V4 versions on Linux 32-bit and 64-bit, Windows XP intel 32 bit, and Mac PowerPC.
 
As I do not have LibreOffice V3.3 I can not prove that the problem actually existed at the time, however I suspect it is likely that it did.

regards, ian.
Comment 2 tommy27 2013-09-10 23:51:49 UTC
@irs 
is bug still here with current 4.1.1 release?
Comment 3 tommy27 2013-11-26 12:30:26 UTC
I move this to NEEDINFO.
please tell us if the issue is still there with recent (4.1.3) LibO releases.
Comment 4 irs 2014-01-06 07:43:32 UTC
(In reply to comment #3)
> I move this to NEEDINFO.
> please tell us if the issue is still there with recent (4.1.3) LibO releases.

Hi Tommy,

The bug still exists using a more recent version of LibreOffice (x86_64 bit):
$ libreoffice --version
LibreOffice 4.1.3.2 410m0(Build:2)

This is on the Linux 64-bit platform: 
$ uname -a
Linux ian-ubuntu-13-10 3.11.0-15-generic #23-Ubuntu SMP Mon Dec 9 18:17:04 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

I used the Bug Demo scipt 82724 https://bugs.freedesktop.org/attachment.cgi?id=82724 to test for the bug. If the BASIC IDE Window is not opened there is no problem. The bug only occurs once the BASIC IDE window has been opened in a manner as though you are going to edit either Module1 or Module2 of the Bug Demo code.

My guess as to the cause of the bug is that after the "removeByName" has been executed then the BASIC IDE Window is refreshed so that the removed module is no longer displayed. This refresh appears to happen OK as the removed module disappears from the tab list of Modules in the IDE window, however at the end of this sequence it fails to link back and execute the next line of BASIC script code. Instead it quietly exits execution of the script.

regards, Ian.
Comment 5 pierre-yves samyn 2014-01-17 17:08:26 UTC
Hello

I reproduce on windows 7/64 with Version: 4.2.0.2
Build ID: cd65d6220c5694ee7012d7863bcde3455c9e3c30

Regards
Pierre-Yves
Comment 6 Joel Madero 2015-05-02 15:41:26 UTC Comment hidden (obsolete)
Comment 7 pierre-yves samyn 2015-05-09 11:04:27 UTC
Hi

Still reproduced on windows 7/64 & Version: 4.4.3.2
Build ID: 88805f81e9fe61362df02b9941de8e38a9b5fd16
Locale: fr_FR

Regards
Pierre-Yves
Comment 8 QA Administrators 2016-09-20 09:41:49 UTC Comment hidden (obsolete)
Comment 9 Buovjaga 2019-08-11 11:00:24 UTC
Still repro. I don't see the messagebox with "This message is displayed as after the removeByName() was performed, the subroutine did not terminate", if I have IDE open.

Arch Linux 64-bit
Version: 6.4.0.0.alpha0+
Build ID: 37fc9f51a8de11d40632e8cda17ccf1fa4b1f503
CPU threads: 8; OS: Linux 5.2; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 6 August 2019
Comment 10 QA Administrators 2021-09-19 03:45:02 UTC Comment hidden (obsolete)
Comment 11 QA Administrators 2023-09-20 03:06:23 UTC
Dear irs,

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