Bug 146101 - Notebookbar is displayed regardless of the context
Summary: Notebookbar is displayed regardless of the context
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
7.2.3.2 release
Hardware: All All
: medium normal
Assignee: Dev
URL:
Whiteboard: target:26.2.0 target:25.8.3
Keywords:
Depends on:
Blocks: Extension-Tight-Integration
  Show dependency treegraph
 
Reported: 2021-12-07 18:05 UTC by Dorange-Pattoret Didier
Modified: 2025-10-16 07:51 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
A small extension for tests (1.31 MB, application/vnd.openofficeorg.extension)
2021-12-07 18:06 UTC, Dorange-Pattoret Didier
Details
Another extension for test (2.89 MB, application/vnd.openofficeorg.extension)
2022-01-31 13:09 UTC, Dorange-Pattoret Didier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dorange-Pattoret Didier 2021-12-07 18:05:20 UTC
Description:
Display does not take context into account

Steps to Reproduce:
1.Install Writer2ePub


Actual Results:
Notebookbar is always displayed


Expected Results:
2.Notebookbar is displayed only with TextDocument



Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 7.2.4.1 / LibreOffice Community
Build ID: 27d75539669ac387bb498e35313b970b7fe9c4f9
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: en-US (fr_FR.UTF-8); UI: en-US
Calc: threaded
Comment 1 Dorange-Pattoret Didier 2021-12-07 18:06:31 UTC
Created attachment 176772 [details]
A small extension for tests
Comment 2 Dorange-Pattoret Didier 2021-12-22 06:18:25 UTC
I confirm for LO windows :
Version: 7.2.4.1 (x64) / LibreOffice Community
Build ID: 27d75539669ac387bb498e35313b970b7fe9c4f9
CPU threads: 8; OS: Windows 10.0 Build 19041; UI render: Skia/Vulkan; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL
Comment 3 BogdanB 2021-12-22 11:53:22 UTC Comment hidden (obsolete)
Comment 4 Dorange-Pattoret Didier 2021-12-22 15:17:50 UTC
Hello,
Follow View -> User Interface 
Choose Tabbed and Apply to all.
And then follow Extension.
The epub icons must be visible only with Writer.
Or they are visible with all other components Calc, Draw, etc.
That is the problem.

The code in Addon_new.xcu is :
<node oor:name="m1" oor:op="replace">
                        <prop oor:name="Context" oor:type="xs:string">
                            <value>com.sun.star.text.TextDocument</value>
                        </prop>
                        <prop oor:name="URL" oor:type="xs:string">
                            <value>macro:///writer2epub.A_main.writer2epubMain</value>
                        </prop>
                        <prop oor:name="ImageIdentifier" oor:type="xs:string">
                            <value>%origin%/icons/logo</value>
                        </prop>
                        <prop oor:name="Title" oor:type="xs:string">
                            <value>writer2epub</value>
                        </prop>
                        <prop oor:name="Target" oor:type="xs:string">
                            <value>_self</value>
                        </prop>
                    </node>
The Context is only "com.sun.star.text.TextDocument", so icons must visible ONLY with Writer.
Comment 5 BogdanB 2021-12-22 20:20:46 UTC
I don't know if this setting you have here should apply just for writer or not, but I confirm that this extension is seen also in Calc, Draw, etc

We have to wait for someone with more experience in extensions.

Version: 7.2.4.1 / LibreOffice Community
Build ID: 27d75539669ac387bb498e35313b970b7fe9c4f9
CPU threads: 4; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 6 BogdanB 2021-12-22 20:26:56 UTC
Do you know how to use this extension in default view in LibreOffice?
Comment 7 Dorange-Pattoret Didier 2021-12-23 09:43:32 UTC
Hello,

The belowed extension comes as example from this "official" page : https://wiki.documentfoundation.org/Development/NotebookBar/Extensions

If you want to use Epub with Standard Interface (not Tabbed) you have to dowload it here : https://extensions.libreoffice.org/en/extensions/show/writer2epub

Unfortunatly, that will not fix the bug.

Have a nice day.
Comment 8 Dorange-Pattoret Didier 2022-01-15 09:41:08 UTC Comment hidden (obsolete)
Comment 9 Timur 2022-01-21 13:25:57 UTC
In OSS you may fix yourself, find or pay someone fix it - or just wait as long as it takes, days or decades. 

Here, http://writer2epub.it/download/ shows that extension is for LO 4, not updated. So this is a problem for extension developer. 

Not sure why you would use that, LO has Export as ePUB. 
Please see and if it's missing something, search existing bugs and report.
Comment 10 Timur 2022-01-21 13:28:26 UTC
I don't use it, but I see some others: 
https://extensions.libreoffice.org/?q=epub
Comment 11 Dorange-Pattoret Didier 2022-01-30 10:20:15 UTC
Hello,
The bug in not in writer2pub but in LibreOffice.
I get the same problem with an other extension, that a build myself ...

I do'nt understand you answer.

It's a real bug. 

Did you test the provided extension ?

Did you see, in Addon_new.xcu, the lines : 
<prop oor:name="Context" oor:type="xs:string">
     <value>com.sun.star.text.TextDocument</value>
</prop> ?

Did you see the notebookbar icons are visible in Writer (that's right) BUT in Calc and in all other modules (that's wrong) ?

Thanks for your answer.
Comment 12 Timur 2022-01-30 13:12:35 UTC Comment hidden (obsolete)
Comment 13 Timur 2022-01-30 13:13:56 UTC Comment hidden (obsolete)
Comment 14 Alex Thurgood 2022-01-30 21:00:58 UTC
The issue is not one relating to the epub extension per se, but rather why the Addon.xcu properties, which should limit display of an extensions icons to a particular module, e.g. Writer, are being ignored by the Notebookbar.

For those that don't know him, Didier is the developer of the Dmath extension, and is not a complete newb when it comes to developing extensions.

The question should be :

Why are the props being set in the XCU ignored by the Notebookbar? 

As the behaviour was confirmed in comment 5, setting as new.
Comment 15 Alex Thurgood 2022-01-30 21:08:55 UTC
@Didier: do all Writer-specific extensions suffer from this problem?

If not, then there must be something different in their respective Addon.xcu files, so that they are only displayed in Notebookbar in the correct module.
Comment 16 Alex Thurgood 2022-01-30 21:12:58 UTC
Is this linked to bug 103170 in any way?
Comment 17 Szymon Kłos 2022-01-31 11:21:32 UTC Comment hidden (obsolete)
Comment 18 Dorange-Pattoret Didier 2022-01-31 13:08:28 UTC
Hello Everybody,

The joined extension is a reduced version of Dmaths 6.2 available for LO >= 7.1

There is 2 icons.

Choose View -> User Interface -> Standard Toolbar for all.

The red icon is visible in Calc, the yellow in Writer. That's right.

Choose View -> User Interface -> Tabbed for all.

In the extension menu, both icons are visible. That's wrong. Here is the problem.
For me it's a bug.

In Addons.xcu, org.openoffice.Office.addon.DMathsAddinNoteBookBar, I wrote :
<prop oor:name="Context" oor:type="xs:string">
<value>com.sun.star.sheet.SpreadsheetDocument</value>
</prop>
So the red icon should be visible only with Calc not in Writer

In Addons.xcu, org.openoffice.Office.addon.DMathsNoteBookBar, I wrote :
<prop oor:name="Context" oor:type="xs:string">
<value>com.sun.star.text.TextDocument</value>
</prop>
So the yellow icon should be visible only with Writer not in Calc

Thanks for all.
Comment 19 Dorange-Pattoret Didier 2022-01-31 13:09:47 UTC
Created attachment 177935 [details]
Another extension for test
Comment 20 Dorange-Pattoret Didier 2022-02-21 13:10:31 UTC Comment hidden (no-value)
Comment 21 Dorange-Pattoret Didier 2023-02-21 09:32:49 UTC Comment hidden (no-value)
Comment 22 Dorange-Pattoret Didier 2023-03-29 13:43:39 UTC Comment hidden (no-value)
Comment 23 Franklin Weng 2025-09-17 03:21:44 UTC
Still reproducible in

Version: 25.8.0.2 (X86_64)
Build ID: 80a8bc2ef75d415a197e282da0ebf917315d5e24
CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: kf5 (cairo+xcb)
Locale: zh-TW (zh_TW.UTF-8); UI: zh-TW
Calc: threaded
Comment 24 B. Antonio Fernández 2025-09-17 23:10:41 UTC
Also reproducible in  version
25.8.1.1
Comment 25 Dev 2025-09-25 07:06:21 UTC
We submitted a patch to solve this issue:

https://gerrit.libreoffice.org/c/core/+/191418

Please test it and review it.
Comment 26 Dorange-Pattoret Didier 2025-09-25 07:51:07 UTC Comment hidden (obsolete)
Comment 27 Dev 2025-09-25 11:49:30 UTC
(In reply to Dorange-Pattoret Didier from comment #26)
> Hello,
> Thanks for your work.
> Which nighly build to use for tests ?
> Thanks.

It has to be reviewed, accepted and merged into master first...
Comment 28 Dorange-Pattoret Didier 2025-09-29 10:46:00 UTC
Hello,
Still does not work with nightly build date 29 September.

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 0d986755e4153230670c820dc52cc40cd72dfa87
CPU threads: 4; OS: Linux 6.14; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
Calc: threaded

I'l try afternoon with Windows 11.

Thanks.
Comment 29 Franklin Weng 2025-09-29 11:15:52 UTC
(In reply to Dorange-Pattoret Didier from comment #28)
> Hello,
> Still does not work with nightly build date 29 September.
> 
> Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
> Build ID: 0d986755e4153230670c820dc52cc40cd72dfa87
> CPU threads: 4; OS: Linux 6.14; UI render: default; VCL: gtk3
> Locale: fr-FR (fr_FR.UTF-8); UI: en-US
> Calc: threaded
> 
> I'l try afternoon with Windows 11.
> 
> Thanks.

No, you need to wait for the patch being reviewed, accepted and merged into the source code, then you can try nightly build.  It hasn't been reviewed yet.

I tried it by applying the patch and compiling the source myself.  It worked, though I didn't test with many cases.
Comment 30 Dorange-Pattoret Didier 2025-10-01 09:03:24 UTC
Hello,
(In reply to Franklin Weng from comment #29)
> (In reply to Dorange-Pattoret Didier from comment #28)
> > Hello,
> > Still does not work with nightly build date 29 September.
> > 
> > Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
> > Build ID: 0d986755e4153230670c820dc52cc40cd72dfa87
> > CPU threads: 4; OS: Linux 6.14; UI render: default; VCL: gtk3
> > Locale: fr-FR (fr_FR.UTF-8); UI: en-US
> > Calc: threaded
> > 
> > I'l try afternoon with Windows 11.
> > 
> > Thanks.
> 
> No, you need to wait for the patch being reviewed, accepted and merged into
> the source code, then you can try nightly build.  It hasn't been reviewed
> yet.
> 
> I tried it by applying the patch and compiling the source myself.  It
> worked, though I didn't test with many cases.

So please inform us when the nighly build will be avalaible
Thanks.
Comment 31 Commit Notification 2025-10-02 09:16:30 UTC
Dev Lo committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f44eca0ace11a195b0516a6cadab9be0a4857331

tdf#146101 Filter Context prop in Notebookbar Extension tab and menu

It will be available in 26.2.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 32 Dorange-Pattoret Didier 2025-10-03 14:03:47 UTC
Hello,
I tested under Linux Ubuntu and Win 11 : it works fine.
I'll make the test tomorrow under MacOS.

Many thanks ....
Comment 33 Dorange-Pattoret Didier 2025-10-09 07:28:48 UTC
Hello,
Sorry but I can test it in MACOS Sonoma 14
I get an error message : the file downloaded is wrong.
So I do'nt know what to do ...
Comment 34 Commit Notification 2025-10-10 06:27:34 UTC
Dev Lo committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/e4063dc67bd79aa34d23de292b6b462d9339304f

tdf#146101 Filter Context prop in Notebookbar Extension tab and menu

It will be available in 25.8.3.

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 35 Dorange-Pattoret Didier 2025-10-15 15:37:16 UTC
Hello,
Tested with LoDev 25.8.3.0 under Windows : it works fine.
Many thanks !
Comment 36 BogdanB 2025-10-15 15:50:36 UTC
Dev Lo, you can mark the bug as Resolved.
Comment 37 BogdanB 2025-10-16 07:51:55 UTC
Verified based on comment 35.