Bug 147667 - EDITING: double use of shortcut 'Alt+O' in Paste Special (German version only !)
Summary: EDITING: double use of shortcut 'Alt+O' in Paste Special (German version only !)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.0.3 release
Hardware: All All
: medium trivial
Assignee: Heiko Tietze
URL:
Whiteboard: target:7.4.0
Keywords: accessibility
Depends on:
Blocks:
 
Reported: 2022-02-26 08:34 UTC by c.riether
Modified: 2022-03-04 10:46 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of 'Inhalte einfügen' (Paste Special) (21.65 KB, image/png)
2022-02-26 08:37 UTC, c.riether
Details
Screenshot of the "Paste Special" dialog after patch on kf5 with Breeze style on Debian testing (41.16 KB, image/png)
2022-02-28 13:56 UTC, Michael Weghorn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description c.riether 2022-02-26 08:34:50 UTC
Description:
Its a Bug in the German version of LibreOffice Calc!
Using 'Inhalte einfügen' 'Strg+Shift+V' (Paste Special) the shortcut 'Alt+O' is used for 'Formeln' (Formula) and 'Ok'. 
Some versions of LibreOffice Calc ago I think shortcut 'Alt+F' has been used for Formats.


Steps to Reproduce:
1. switch language of User Interface to German
2. copy cell data
3. select new cell
4. Paste Special (menu or shortcut)
5. select 'Formula' using shortcut 'Alt+O'
6. select 'OK' using 'Alt+O' twice 

Actual Results:
It's annoying, not really a bug.

Expected Results:
e.g. Shortcut 'Alt+F' for Formeln (Formula)


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.3.0.3 (x64) / LibreOffice Community
Build ID: 0f246aa12d0eee4a0f7adcefbf7c878fc2238db3
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded
Comment 1 c.riether 2022-02-26 08:37:10 UTC
Created attachment 178552 [details]
Screenshot of 'Inhalte einfügen' (Paste Special)
Comment 2 Julien Nabet 2022-02-26 09:47:46 UTC
Heiko/Rafael: noticing "F_ormulas" in sc/uiconfig/scalc/ui/pastespecial.ui from 4c0c77f10c3967c720cb0511dc26986a5b003f33
"Author: Heiko Tietze <tietze.heiko@gmail.com>
Date:   Tue Nov 24 17:14:08 2020 +0100

    Resolves tdf#134802 - Improved "Paste Special" dialog box
    
    * New design
    * Paste Format Only added
    * Code clean-up
"

thought you might have some opinion here.

A quick fix would be to change German translation to use:
"_Formeln" instead of "F_ormeln" in:
  27395 #. jrjYA
  27396 #: sc/uiconfig/scalc/ui/pastespecial.ui:423
  27397 msgctxt "pastespecial|formulas"
  27398 msgid "F_ormulas"
  27399 msgstr "F_ormeln"

but I think the pb is more general than just for German language.

Of course, I know that "F" is already used for "Values & Formats" and shortcuts are always a plague to deal with because you can't satisfy everybody when there is a bunch of options.
Comment 3 Heiko Tietze 2022-02-28 10:03:24 UTC
The issue is also relevant on the English UI with _All and _Add.

We can omit the underscores and let the software find the best accelerator (will submit a patch for this; l10n needs to drop the underscores in translations too). But it doesn't work well for complex dialogs like this because all characters of "Add", for example, are used at other labels.

I wonder if this particular issue is really annoying. You can always press the hotkey again to get to the next element... which is true for menus but not dialogs. The hotkeys alt+A for _Add/_All or alt+O for F_ormat/_Okay are just ignored.

Solution might be to just focus the control in this case and toggle the checkbox or execute the command per space/enter. What do you think, Caolan?
Comment 4 Caolán McNamara 2022-02-28 11:17:01 UTC
As far as I can see for this dialog (in english UI) for gen and gtk only focusing when the mnemonic is duplicated is what is already (mostly) happening.

The duplicate mnemonics are cycled through if you repeatedly press it, e.g. alt+a and alt+o but if there are duplicates then only focus is moved[1]. So alt+f activates "Values & _Formats" and alt+p toggles on "Trans_pose" while alt+o only moves focus between "F_ormulas" and "_OK".

[1] except in gen for the radiobutton case where the radiobutton is auto toggled on even if there is duplicates which looks like it could be improved. https://gerrit.libreoffice.org/c/core/+/130691/1
Comment 5 Commit Notification 2022-02-28 12:48:48 UTC
Heiko Tietze committed a patch related to this issue.
It has been pushed to "master":

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

tdf#147667 - Remove hard-coded underscore from UI

It will be available in 7.4.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 6 Heiko Tietze 2022-02-28 13:05:32 UTC
(In reply to Caolán McNamara from comment #4)
> The duplicate mnemonics are cycled through if you repeatedly press it...

True, works for me as well. Problem is that kf5 not nicely shows the focus. Anyway, the patch removes all duplicates, which could be an a11y problem itself.

Last word for Michael. Revert and WF or keep and FX?
Comment 7 Michael Weghorn 2022-02-28 13:56:20 UTC
Created attachment 178578 [details]
Screenshot of the "Paste Special" dialog after patch on kf5 with Breeze style on Debian testing
Comment 8 Adolfo Jayme Barrientos 2022-02-28 14:01:41 UTC
Would it make sense to push more patches like that to nuke the hardcodings and let LO choose a mnemonic automatically? (But then, LO’s algorithm would need improvements like the quality standards described in [1], which humans can currently implement but at a huge time cost — us translators would hugely appreciate that)

[1]: https://wiki.documentfoundation.org/ES/Guía_de_estilo#Aceleradores
Comment 9 Heiko Tietze 2022-02-28 14:06:31 UTC
(In reply to Michael Weghorn from comment #7)
> Screenshot of the "Paste Special" dialog...

Question is, do we accept that some controls don't have a mnemonic anymore? If not, Adolfo's question is obsolete. If yes, I'd say this is the way to go (and improve the auto selection of mnemonic by allowing duplicates).
Comment 10 Michael Weghorn 2022-02-28 14:18:05 UTC
(In reply to Heiko Tietze from comment #6)
> (In reply to Caolán McNamara from comment #4)
> > The duplicate mnemonics are cycled through if you repeatedly press it...
> 
> True, works for me as well. Problem is that kf5 not nicely shows the focus.

That probably depends on the Qt style used. There were some changes to how focus is indicated in the KDE Breeze style somewhat recently, e.g. https://invent.kde.org/plasma/breeze/-/merge_requests/160 is one example of a backport for Plasma 5.23.
Attachment 178578 [details] shows what it looks like for me with kf5 on Debian testing, using the Breeze style  (breeze 4:5.23.5-1). In that screenshot, "Objects" is focused, indicated by the blue line.
(When using gtk3 and the Breeze Gtk style, focus is not properly indicated, but that seems to be a problem of the Breeze Gtk style, it's fine when using e.g. the Emacs style instead.)

> Anyway, the patch removes all duplicates, which could be an a11y problem
> itself.
Using the English UI, some items no longer have any accelerator key at all any more with the commit from comment 5 in place (e.g. "Formats Only", "All", "Formats", "As Link", "Add" when using gtk3, different ones when using kf5).

Without being an expert, I tend to think that having duplicate accelerator keys for some items is better than having none at all, because you can still get to those items by pressing the accelerator key twice, while you can only press the Tab key several times if they have no accelerator at all.
But I wouldn't see that as an a11y-specific question, rather one that applies the same for any power user preferring to use the keyboard only, similar to the scenario reported here.

(In reply to Heiko Tietze from comment #9)
> Question is, do we accept that some controls don't have a mnemonic anymore?
> If not, Adolfo's question is obsolete. If yes, I'd say this is the way to go
> (and improve the auto selection of mnemonic by allowing duplicates).

If there's a way to improve auto-selection to allow for duplicates, I think that might be a way to move forward, but don't have a strong opinion on that.
Comment 11 Caolán McNamara 2022-02-28 14:48:12 UTC
(In reply to Adolfo Jayme from comment #8)
> Would it make sense to push more patches like that to nuke the hardcodings
> and let LO choose a mnemonic automatically?

Some dialogs have very well known mnemonics, letting them get chosen automatically will mean a change to what they currently are, so I suspect it would trigger an endless list of "regressions".
Comment 12 Commit Notification 2022-02-28 15:26:23 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

Related: tdf#147667 don't toggle radiobutton on mnemonic if it's not unique

It will be available in 7.4.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 13 Julien Nabet 2022-02-28 16:50:49 UTC
IMHO OK, Cancel, ... should always have the same shortcuts for each locale.
Then just wonder:
- what about if people want compatibility with MSOffice and auto generated shortcut LO wouldn't correspond?
- when modifying a menu, a dialog, wouldn't shortcuts be regenerated from scratch and so someone accustomed to some shortcuts in a dialog/menu should learn them from scratch because of this regeneration?

In brief, it would be great to remove hardcoded shortcuts but wonder if there wouldn't be more understandable complaining from people.
Comment 14 Heiko Tietze 2022-03-04 10:46:00 UTC
Remaining pieces went into bug 147762 - Automatic assigned mnemonics not always set. Resolving this one as fixed.