Bug 146101 - Notebookbar is displayed regardless of the context
Summary: Notebookbar is displayed regardless of the context
Status: ASSIGNED
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: Szymon Kłos
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-07 18:05 UTC by Dorange-Pattoret Didier
Modified: 2023-03-29 13:43 UTC (History)
5 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
I will try to look into this
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
Hello,
Nobody to fix this bug ?
Best regards.
Comment 22 Dorange-Pattoret Didier 2023-03-29 13:43:39 UTC
Hello,
Is there anyone to fix this bug ?
Thanks.
Didier.