Bug 50672 - Unity: Recent file menu removes underscore from file names
Summary: Unity: Recent file menu removes underscore from file names
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
3.5.3 release
Hardware: All Linux (All)
: medium trivial
Assignee: Samuel Mehrbrodt (CIB)
URL:
Whiteboard: target:4.2.4
Keywords: difficultyInteresting, easyHack, skillCpp, skillDebug
: 60715 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-06-04 03:41 UTC by Edwin
Modified: 2016-02-18 16:37 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Visualization of Problem (106.59 KB, image/png)
2013-01-15 20:36 UTC, Edwin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Edwin 2012-06-04 03:41:42 UTC
Ubuntu 12.04
LibreOffice 3.5.3.2
Build ID 350m1 (Build 2)

Using Draw, the recent file menu botches file names with underscores:
figure_Partitions.odg is shown as:
figurePartitions.odg

Although not a big deal, it seems like it is unnecessary to sanitize the file paths of special characters just to display in the recent menu. 

I have only tried in Draw, and with the underscore character.

I originally filed in Ubuntu: https://bugs.launchpad.net/bugs/1008277, and was directed upstream.
Comment 1 Hashem Masoud 2012-09-24 06:32:11 UTC
(In reply to comment #0)
Works for me:
Version 3.6.1.2 (Build ID: e29a214) Slackware Linux 13.37

Underscores in filename appear in the list of "Recent Documents".
Please re-open if you think otherwise.
Comment 2 Edwin 2013-01-15 20:36:56 UTC
Created attachment 73119 [details]
Visualization of Problem

I filed this bug originally a while back, and it was marked as invalid.  Just today, I noticed that I am still encountering the problem.  

I am still on Ubuntu, 64-bit.  Now I am running 12.10, and LibreOffice is at Version 3.6.2.2 (Build ID: 360m1 (Build:2))

The filenames are still being goofed in the Recent Menu.  I have attached an image.  For example, I commonly have files named:

figure_XYDimensions.png
figure_SomethingElse.png

In the recent menu, the underscores are gone.  And (this may help narrow down the problem) when the recent menu is first shown, the filenames are plain, but as I hover over that menu, the underscores appear as an underline to the letter following their original position.  This hints that the underscore is perhaps being interpreted as the shortcut for that menu item.  

This happens in the core LibreOffice, not just when a single instance (calc, draw, etc.) is open.

Let me know if I can provide any further details, I know it isn't a serious issue, but it seems like it may be a simple fix to just *not* process recent file underscores as shortcut identifiers.

Thanks!!
Comment 3 Edwin 2013-01-15 20:39:23 UTC
It has been a while since this was opened, but the exact problem is still occurring for me.  I have updated my info (versions, etc.) and provided more information of the problem in comment #2, and also uploaded a screenshot of the problem.
Comment 4 Christine Emrich 2013-02-06 20:23:38 UTC
I reproduced the bug with version 3.6.4.3 (Build ID: 360m1 (Build:3)) on an Ubuntu system (12.10, 64 bit). 
On my windows machine (win7, 64 bit, libreoffice Version 3.6.4.3 (Build ID: 2ef5aff)) the bug didn't occur.

Building the latest version from source (4.1.0.0.alpha0+ (Build ID: b3e64c3708fa19a87a0df31f6dbc4ea4753b23d)) the bug is gone.

It seems to be fixed but I don't know exactly in which version. Should the ticket remain open?
Comment 5 M 2013-02-12 09:20:30 UTC
*** Bug 60715 has been marked as a duplicate of this bug. ***
Comment 6 Simon Anders 2013-04-07 10:21:00 UTC
Bug still appears in LibreOffice 4.0.2.

Note, by the way, that only the _first_ underscore in a file name gets mangled. It seems that the GUI toolkit misinterprets the underscore as a hot-key marker.
Comment 7 V Stuart Foote 2013-04-07 17:32:14 UTC
From OP of bug 60715:
>Problem description: The Recent Documents list removes underscores "_" from the >filename and shows the filenames without them. Writer, Impress and Calc do this, >so it is probably the same for all.
>              
>Operating System: Ubuntu
>Version: 3.6.4.3 release

Appears to have affected more than just Draw -- adjusting component to UI. LibreOffice repo rpm installs of 3.6.6 and 4.0.2 work for me on Fedora 18 with GNOME 3 or LXDE.  Since so far only reported on Ubuntu 12.04 & 12.10 - is this a Unity or possibly a GTK+ issue?

@Simon Anders - details please of your OS build and source of LibreOffice 4.0.2? Are you on an Ubuntu install?
Comment 8 V Stuart Foote 2013-04-07 19:38:17 UTC
Adjusting summary replacing "sanitizes" with "removes underscore" as more more precise description of issue--and only because it will help when searching issues.
Comment 9 Samuel Mehrbrodt (CIB) 2013-09-26 18:39:19 UTC
This seems to be an Unity issue, it doesn't appear in the usual menus, only in the Unity Global menu.

Please report the problem there.
Comment 10 Björn Michaelsen 2013-10-03 19:35:05 UTC
Unity integration is part of upstream code, not a vendor patch, so reopening.

(and yes, reproducable in 4.1.2~rc3 on saucy)
Comment 11 Björn Michaelsen 2013-10-10 21:56:49 UTC
Marking this as an challenging Easy Hack.

The translation from LibreOffice vcl to gtks menumodel happens around here:

http://opengrok.libreoffice.org/xref/core/vcl/unx/gtk/window/gtksalmenu.cxx#302
Comment 12 Björn Michaelsen 2013-10-18 20:03:41 UTC
CCing developer list to Easy Hacks missing this.
Comment 13 Michaël Lefèvre 2014-03-24 14:46:06 UTC
LibreOffice 4.1.3.2 (1:4.1.3-0ubuntu1)
Ubuntu 13.10

The problem is stil present and I found the following precision :
- work normaly under Gnome 3.8
- reproduce on Unity, only in the global menu.

The problem's not present in the welcoming splash screen when you start LibreOffice with plain new file, even when running in Unity.
I don't know if the same code used in both menu. 

cf : http://opengrok.libreoffice.org/xref/core/framework/source/uielement/recentfilesmenucontroller.cxx#130

GTK used to consider undescore as mnemonic to give shorcut access in the menu.
Comment 14 Jean-Baptiste Faure 2014-03-24 19:13:29 UTC
I confirm the problem on my own build of LibreOffice 4.2.4.0.0+ under Ubuntu 13.10 x86-64.

Best regards. JBF
Comment 15 Michaël Lefèvre 2014-03-24 19:48:50 UTC
While loolikng at https://bugzilla.redhat.com/show_bug.cgi?id=963307 , maybe we could escape the underscope in the filename.

But this bug doesn't not appear while running a plain Gnome session (tested). So I wonder if such a workaround is really worth it. Isn't there a way to fix Unity integration somewhere else ?
Comment 16 Michaël Lefèvre 2014-03-24 20:41:27 UTC
Ok, found another interesting point.

https://bugs.launchpad.net/ubuntu/+source/unity-gtk-module/+bug/1260777

If anybody running bleeding edge trusty Ubuntu could try ?
Comment 17 Michaël Lefèvre 2014-03-27 21:10:48 UTC
Just tested with 14.04 having unity-gtk-* package at version 0.0.0+14.04.20140319.
This hasn't fix this bug.
Comment 19 Jean-Baptiste Faure 2014-03-28 13:14:48 UTC
(In reply to comment #18)
> Fixed with
> http://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=f6bcdc5ae6da9cb9b13bdc3551bef917d8b0362d

Thank you very much for this fix. Do you plan to backport it to 4.2 branch ?

Best regards. JBF
Comment 20 Commit Notification 2014-03-28 16:20:49 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d6bc8ed3356d88231cca0306790f300517b7fae2&h=libreoffice-4-2

fdo#50672 Escape underscores in menus for unity


It will be available in LibreOffice 4.2.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 21 Samuel Mehrbrodt (CIB) 2014-03-28 16:24:43 UTC
> Thank you very much for this fix. Do you plan to backport it to 4.2 branch ?

You're welcome. I didn't plan this, but now it has happened :)
Comment 22 Jean-Baptiste Faure 2014-03-28 19:29:25 UTC
(In reply to comment #21)
> > Thank you very much for this fix. Do you plan to backport it to 4.2 branch ?
> 
> You're welcome. I didn't plan this, but now it has happened :)

And it works :-)
Thank you very much !

Best regards. JBF
Comment 23 Björn Michaelsen 2014-03-29 20:16:47 UTC
(In reply to comment #21)
> You're welcome. I didn't plan this, but now it has happened :)

Hi Samuel,

thank you very much for this fix, it was always on my agenda, but with such a low prio that I unfortunately never got to it. Ill make sure it'll be in Ubuntu Trusty on release.

Best, Bjoern
Comment 24 Robinson Tryon (qubit) 2015-12-15 23:24:00 UTC
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyInteresting SkillCpp SkillDebug )
[NinjaEdit]
Comment 25 Robinson Tryon (qubit) 2016-02-18 16:37:13 UTC
Remove LibreOffice Dev List from CC on EasyHacks
(curtailing excessive email to list)
[NinjaEdit]