Bug 107120 - New/update/edit style commands only work with paragraph styles outside of the sidebar
Summary: New/update/edit style commands only work with paragraph styles outside of the...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
5.3.1.2 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Styles-Management Writer-Styles
  Show dependency treegraph
 
Reported: 2017-04-12 13:01 UTC by Thomas Lendo
Modified: 2021-01-14 16:22 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Lendo 2017-04-12 13:01:55 UTC
"Edit Style...", "Update Style..." and "New Style..." in menus, toolbars, sidebars, etc. should be renamend to "Edit Paragraph Style...", "Update Paragraph Style..." and "New Paragraph Style..." because they only apply to paragraphs and not to character or other styles although, for example, a frame and not a frame content is selected.

The wording "style" simplifies the styles concept of LibO in a way that the user will be confused. Style is not only paragraph style.

Steps to reproduce:
See tooltips in Formatting toolbars or tooltips in the properties sidebar or the entry namings in the Styles menus.
Comment 1 Cor Nouws 2017-04-12 13:13:10 UTC
thanks Thomas! > New
Comment 2 Yousuf Philips (jay) (retired) 2017-04-21 10:53:28 UTC
The problem is that these commands were previously only in the sidebar, and i added them to the menubar and toolbar, so they only took into account which tab of the styles and formatting deck of the sidebar was active, and that is what needs to be corrected. They need to work correctly based on where they are executed from based on context.
Comment 3 Yousuf Philips (jay) (retired) 2017-05-27 16:53:44 UTC
@Maxim: Would it be easy to add an argument to these commands so that they work with other style families, as the logic is already there for it based on which tab of the styles & formatting deck you are on.

examples
.uno:EditStyle?FamilyName:string=CharacterStyles
.uno:StyleUpdateByExample?FamilyName:string=NumberingStyles
.uno:StyleNewByExample?FamilyName:string=FrameStyles
Comment 4 QA Administrators 2018-08-28 02:42:55 UTC Comment hidden (obsolete)
Comment 5 QA Administrators 2020-08-28 04:03:35 UTC Comment hidden (obsolete)
Comment 6 Thomas Lendo 2020-09-01 16:08:54 UTC
Adding Heiko and Andreas to CC list as they know about toolbar/sidebar/notebookbar command naming incl. tool tips and can change it. :)

Is this something you can work on?
Comment 7 Heiko Tietze 2020-09-02 08:31:19 UTC
The UNO commands are used for both paragraph and character style, at least, at the sidebar. So we have to apply the label conditionally, or introduce different commands. However, I'm rather for not changing the label to keep the code clean. It's not much of a surprise that "Edit Style" shows the dialog with paragraph properties.
Comment 8 sdc.blanco 2021-01-05 20:56:06 UTC
In reply to Thomas Lendo from comment #0)
> the entry namings in the Styles menus.
fwiw framework/dtd/menubar.dtd indicates "label" is an attribute for menuitem.

It would be possible to change the command names in the Styles menubar for Writer without changing the .uno labels.  

I am willing to make changes in the Writer menubar (alone) -- if such a limited, ad hoc change, is not opposed. 

But have you considered that there are also many popup menus and menus (e.g., forms, report, web) that use these commands, so if an adhoc solution (beyond the main menubar) was required, then it would involve examining all these variations -- while yet another solution is required for all the notebookbars.

(similar issues appear in Calc, Draw and Impress).

> See tooltips in Formatting toolbars or tooltips in the properties sidebar
This is difficult to address at present because the same tooltip is used in Calc (where cell styles are updated and created) and in Draw/Impress for objects. As noted in comment 2 and comment 7, contextual tests are needed, and more importantly, new functionality is required (see comment 3) for it to make sense to have these contextual tooltips.

As for comment 7:
> It's not much of a surprise that "Edit Style" shows the
> dialog with paragraph properties.
Hard to evaluate the reasons behind that assessment...but "surprise" usually involves violation of expectations. In the Style menubar context ....there are many characteristics that afford an expectation that "Edit Style..." can be used for all style families...which is what motivates the offer to change the Style menubar in Writer.
Comment 9 Maxim Monastirsky 2021-01-08 09:03:15 UTC
(In reply to sdc.blanco from comment #8)
> fwiw framework/dtd/menubar.dtd indicates "label" is an attribute for
> menuitem.
> 
> It would be possible to change the command names in the Styles menubar for
> Writer without changing the .uno labels.  
> 
> I am willing to make changes in the Writer menubar (alone) -- if such a
> limited, ad hoc change, is not opposed. 
Please don't. This "menu:label" thing is not translatable, and only meant to store user customization, not to be used during development.
Comment 10 sdc.blanco 2021-01-08 09:28:30 UTC
Thanks for clarification Maxim.

iiuc, then there is no easy way at present to satisfy the OP request (in the sense of adjusting a few labels somewhere). 

Is it fair to say that new (nontrivial?) backend functionality is required?
Comment 11 Maxim Monastirsky 2021-01-08 10:09:09 UTC
(In reply to sdc.blanco from comment #10)
> iiuc, then there is no easy way at present to ... adjusting a few labels
> somewhere).
That's why we introduced the "TargetURL" property for commands. With it you can create as many shortcuts as you want, with different labels and icons, all pointing to the same underlying "real" command.

The only problem is that it doesn't work for buttons in the NB (but it does for menu buttons there), and that part might need some development.

The other thing you should keep in mind is that "commands" created using "TargetURL" are just shortcuts not real commands, so they won't appear as available commands in the customization dialog.
Comment 12 sdc.blanco 2021-01-08 11:16:19 UTC
With insight from comment 11, it should be possible (and not ad hoc) to:

1. make  new ”shortcuts” in officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu 

  - using TargetURL pointing to the current .unos that appear in the Styles menu in Writer.
  - with desired labels for Styles menu in these shortcuts

2. Modify sw/uiconfig/swriter/menubar/menubar.xml to point to these new shortcuts.

Concretely in relation to Styles menubar in Writer, the new labels could be:

              ”Edit Style…”  → ”Edit Selected Paragraph Style”
    ”Update Selected Style”  → ”Update Selected Paragraph Style”
  ”New Style from Selection” → ”New Paragraph Style from Selection”

too long labels?

Use ”current” instead of ”selected” ?
  (because for paragraph style, only need to have cursor placed in paragraph)