Bug 147488 - The Basic IDE does not display the Object Catalog Panel when you open an empty standard macro library
Summary: The Basic IDE does not display the Object Catalog Panel when you open an empt...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.3.0.3 release
Hardware: x86-64 (AMD64) Windows (All)
: low trivial
Assignee: Rafael Lima
URL:
Whiteboard: target:7.6.0
Keywords:
Depends on:
Blocks: BASIC-IDE
  Show dependency treegraph
 
Reported: 2022-02-17 09:01 UTC by Sirius34
Modified: 2023-02-08 11:49 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshot1 (23.41 KB, image/jpeg)
2022-02-17 09:03 UTC, Sirius34
Details
screenshot2 (20.01 KB, image/jpeg)
2022-02-17 09:03 UTC, Sirius34
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sirius34 2022-02-17 09:01:13 UTC
Description:
Good day to all!

I have been using LibreOffice for a long time now.
By chance, on one of the rarely used computers, I ran into a problem in IDE Basic.
On this computer before current use not work with macros in LibreOffice.
When I go to Tools -> Macros -> Edit Macros, IDE Basic window opens.
In this window the "[My Macros & Dialogs].Standard" library is open by default and is empty.
As result – "Object Catalog panel" hide (his normal place - at left part of IDE window), in menu and on toolbar command/button "Object Catalog" is hide or inactive (gray colored).
In order to display the "Object Catalog Panel", you must select any item in the "Current Library" list that is not empty.  
Then "Object Catalog panel" showing.
But in the case of going through Tools -> Macros -> Organize Macros -> LibreOffice Basic..., and in the window that opens, select the desired macros or create a new one, then the opening takes place with the "Object Catalog Panel" shown.
IMHO, it's unintuitive and uncomfortable.

Steps to Reproduce:
1. Open menu "Tools"
2. Select "Macros"
3. Select "Edit Macros"
4. The IDE Basic window opens with the default library "[My Macros & Dialogs].Standard" selected

Actual Results:
If the library "[My Macros & Dialogs].Standard" is empty (as in my case), the "Object Catalog panel" is not displayed (hide), in menu and on toolbar command/button "Object Catalog" is hide or inactive (gray colored).

Expected Results:
Regardless of whether there are any modules in the standard library, the "Object Catalog panel" should be visible, the corresponding menu command and toolbar button should be visible and active.


Reproducible: Always


User Profile Reset: No



Additional Info:
The presence of this problem has been tested on different versions of LibreOffice, up to and including 7.3.0.3, on different computers, in Windows 10 and Linux operating systems.
Resetting the UserProfile was not applied, as the presence of the problem was also checked on a newly installed (clean) Mint 20.3 operating system.
Comment 1 Sirius34 2022-02-17 09:03:25 UTC
Created attachment 178341 [details]
screenshot1
Comment 2 Sirius34 2022-02-17 09:03:59 UTC
Created attachment 178342 [details]
screenshot2
Comment 3 Xisco Faulí 2022-02-17 09:13:52 UTC
Thank you for reporting the bug. To be certain the reported issue is not related to corruption in the user profile, could you please reset your Libreoffice profile ( https://wiki.documentfoundation.org/UserProfile ) and re-test?

I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the issue is still present
Comment 4 Sirius34 2022-02-17 10:04:04 UTC
Thank you for quick answer!
I did the recommended steps: restarted LibreOffice in safe mode, and then opened the IDE Basic window in the way described in the bug report.
The "Object Catalog panel" was displayed. Probably, because one module with an empty Sub was included in the standard library.
I concluded that I deleted this empty module earlier at work, as a result of which the error described in the bug report occurred.
The reasons why the error was repeated in a clean OS are unknown to me. Probably, the installation package LO integrated into the OS distributive was damaged.
However, the problem of not displaying the "Object Catalog panel" in the case of an empty standard library remains, although in fact its cause is different from what I originally formulated.
Comment 5 Sirius34 2022-02-17 10:20:12 UTC
More precisely, the sequence of actions that led to the error is different - this is the complete removal of modules from the standard library (it does not matter how many there were - one or more, it is important that all are removed).
Comment 6 Mike Kaganski 2022-02-17 10:42:01 UTC
So the steps to reproduce:

1. In IDE, make sure that a module in [My Macros & Dialogs].Standard is active
2. Tools->Select Module
3. On Modules tab, remove all modules under My Macros/Standard
   => At the moment of removal of the last module, without closing the dialog, the IDE window under the dialog changes to a blank window without panels
4. Close the dialog and the IDE, and from Writer, start Tools->Macros->Edit Macros
   => The IDE opens as on attachment 178341 [details]; it's similar to what is shown at step 3, but has the navigation toolbar (with small black left/right arrows) at the top.
5. In Tools->Select Module, add a module to Standard
   => It shown normally now.

It looks reasonable that Object Catalog should be still visible, since absence of modules in the current library doesn't mean you shouldn't be able to see and choose another library/module. The editor panel and the watch panel should be disabled, of course; as an enhancement, a "no module selected"-like message could be displayed on the blank.

Setting to new; setting to trivial.
Comment 7 Rafael Lima 2023-01-11 20:24:31 UTC
This actually happens whenever you choose a script document that has no modules in it. A simpler way to reproduce this issue is:

1) Open Writer (a fresh new document Untitled 1)
2) Go to Tools - Macros - Edit Macros
3) In the toolbar, use the Library Selector to choose [Untitled 1].Standard (which is by default an empty library)
4) Notice the blank screen without the Object Catalog

I studied this code today and simply showing the Object Catalog is not that simple, because it must be associated with a LayoutWindow that needs to be either a dialog or a module.

A simple solution would be to create a default Module window whenever the Library contains nothing.

A proposed solution can be found here:
https://gerrit.libreoffice.org/c/core/+/145309
Comment 8 Commit Notification 2023-02-08 11:47:34 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9ebba1d99457a1049c2f61ba15cd4c99a68d74e7

tdf#147488 BASIC: Create empty module when an empty library is selected

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.