Bug 133142 - Changes to XTabPageModel's text or enabled status not reflected in UI
Summary: Changes to XTabPageModel's text or enabled status not reflected in UI
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
7.0.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:7.0.0
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-18 09:34 UTC by Michael Weghorn
Modified: 2022-06-15 09:03 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample extension to demonstrate the issue (4.80 MB, application/vnd.openofficeorg.extension)
2020-05-18 09:35 UTC, Michael Weghorn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Weghorn 2020-05-18 09:34:46 UTC
Description:
When calling XTabPageModel.setEnabled or XTabPageModel.setTitle via UNO API to change the title or enable/disable a tab page via UNO, the UI is not updated accordingly (if the calls happen when the corresponding dialog is already shown on screen).

A sample extension to demonstrate that will be attached.

Steps to Reproduce:
1. install attached sample extension StarterExtensionLHM.oxt
2. start Writer
3. open the extension's dialog via Menu using "Test Extension" -> "Show Dialog"
4. press the "toggle tab" button

Actual Results:
Nothing seems to happen.

Expected Results:
The second tab should toggle its enabled status (i.e. it should become disabled on first press, enabled again on second button press,...) and change its text every time the button is pressed.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.0.0.0.alpha1+
Build ID: 50150601bb103a3bf5881e07d93a0e1d324f2722
CPU threads: 4; OS: Linux 5.6; UI render: default; VCL: kf5; 
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded

Version: 7.0.0.0.alpha1+
Build ID: 50150601bb103a3bf5881e07d93a0e1d324f2722
CPU threads: 4; OS: Linux 5.6; UI render: default; VCL: gtk3; 
Locale: en-GB (en_GB.UTF-8); UI: en-US
Calc: threaded
Comment 1 Michael Weghorn 2020-05-18 09:35:51 UTC
Created attachment 160967 [details]
Sample extension to demonstrate the issue

The relevant lines in the Java source code of the sample extension that are supposed to change the text and enable/disable the tab are the following ones (with 'tabPageModel2' being the second tab's XTabPageModel:

      @Override
      public void actionPerformed(ActionEvent arg0)
      {
    	// when the button is pressed:
    	// toggle enabled/disabled status of the second tab and change its title
        tabPageModel2.setEnabled(!tabPageModel2.getEnabled());
        
        final String text1 = "some text";
    	final String text2 = "other words";
    	String newText = text1;
    	String currentText = tabPageModel2.getTitle();
    	if (currentText.equals(text1)) {
    		newText = text2;
    	}
        tabPageModel2.setTitle(newText);
      }
    });
Comment 2 Michael Weghorn 2020-05-18 09:44:18 UTC
This issue was originally reported by somebody else in our organization.
I've already taken a look.

Fix pending in Gerrit: https://gerrit.libreoffice.org/c/core/+/94402
Comment 3 Commit Notification 2020-05-18 14:29:10 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/92289c5f121499959b6f5edf859e5f34b5b96a78

tdf#133142 UnoControlTabPageContainer: Handle tab property changes

It will be available in 7.0.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.
Comment 4 Michael Weghorn 2022-06-15 09:03:59 UTC
(In reply to Michael Weghorn from comment #0)
> 1. install attached sample extension StarterExtensionLHM.oxt

Note that the attachment 160967 [details] is actually a misnamed zip file containing both the souce code and the built extension. The actual extension to be installed is in `dist/StarterProjectLHM.oxt` inside the zip archive.