Bug 74064 - File Name detection with "File save as" should be last Period, not first Period (Linux only)
Summary: File Name detection with "File save as" should be last Period, not first Peri...
Status: REOPENED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Libreoffice (show other bugs)
Version: 4.2.0.1 rc
Hardware: All Linux (All)
: low minor
Assignee: Rachit Gupta
QA Contact:
URL:
Whiteboard: target:4.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-26 05:03 UTC by Joel Madero
Modified: 2014-03-22 03:18 UTC (History)
6 users (show)

See Also:
i915 platform:
i915 features:


Attachments
save dialog Win7 (5.88 KB, image/png)
2014-01-26 08:33 UTC, tommy27
Details
FileNameInUbuntu (85.17 KB, image/jpeg)
2014-01-26 18:43 UTC, Joel Madero
Details

Description Joel Madero 2014-01-26 05:03:56 UTC
When you open a save as dialog by default the name of the file is highlighted (which is good as it's assumed that if you're saving as you want to change the name) but the algorithm that detects the file name is wrong as it looks for the first period in the file vs. the last. 

Steps:
Open writer
Save as "this vs. that" without the quotes
Save as again

Observed:
"This vs." is highlighted

Expected
"This vs. That" is highlighted (up to the . of .odt)

Marking as:
Minor -- doesn't prevent high quality work but can slow down workflow a bit
Low -- easy work around, default of low seems accurate

Probably an easy hack so marking as such
Comment 1 tommy27 2014-01-26 06:17:53 UTC
I do not reproduce it under Win7 64bit with 4.1.4.2 and 4.2.1.0.0+
Build ID: 88cd9632e081f5839cf9fddf60cbff0c099e2968
TinderBox: Win-x86@42, Branch:libreoffice-4-2, Time: 2014-01-09_22:46:56
Comment 2 Joel Madero 2014-01-26 08:21:35 UTC
Interesting - so for you it highlights the whole name all the way up until the .odt? If this is Linux only that would be really surprising but I suppose you never know
Comment 3 tommy27 2014-01-26 08:33:26 UTC
Created attachment 92801 [details]
save dialog Win7

@Joel 
this is what I see anymetime I resave.
the whole filename and extension as well are highlighted.
post yours to show me the difference.
Comment 4 Cor Nouws 2014-01-26 14:33:33 UTC
and for me - under Ubuntu - there is never anything selected with "File save as"
Comment 5 Joel Madero 2014-01-26 18:43:25 UTC
Wow looks like linux only
Comment 6 Joel Madero 2014-01-26 18:43:39 UTC
Created attachment 92821 [details]
FileNameInUbuntu
Comment 7 Joel Madero 2014-01-26 18:44:52 UTC
@Cor - I don't use LibreOffice dialogs. When I turn those on nothing is selected (another bug report I suppose, or at least an enhancement request)
Comment 8 Tomaz Vajngerl 2014-01-26 23:02:07 UTC
I can confirm this behaviour under Linux (Ubuntu) with system dialogs.
Comment 9 Jorendc 2014-01-29 12:48:20 UTC
Indeed Linux only. Can't reproduce using Mac OSX. Full filename is selected
Comment 10 Rachit Gupta 2014-02-22 07:08:14 UTC
I wish to work on this bug, can someone provide with a little bit of help? :)

Regards,
Rachit Gupta
Comment 11 Joel Madero 2014-02-23 20:31:43 UTC
@Rachit - fantastic. I just want to confirm you've already built LibreOffice ? I will try to find someone to give some code pointers but if you haven't already built we'll need you to start there :) Let me know if you need assistance
Comment 12 Michael Meeks 2014-02-24 10:07:08 UTC
Hmm =) so this could be at the intersection of what the gtk+ file selector does magically for you, and what we do. AFAIK we don't put the extension into the file-picker there but append it ourselves; of course if the user adds one that is fine; lets hope '. that' is not a filter name ;-) if you want to save as:

foo.doc.doc

you will not be able to enter 'foo.doc' - you have to enter it in full;

Anyhow - Rachit - you'd want to git grep for the gtk file selector API:

git grep -3 gtk_file_chooser

will show you where that is =)
Comment 13 Rachit Gupta 2014-02-24 13:17:15 UTC
@Joel, yes i have built LO, I have already solved an EasyHack task ;)

@Joel and @Michael, I think the problem is only in the systems with GTK as their Desktop Environment. My friend uses Kubuntu, and there is no highlight on the file name (as also mentioned in Comment#4).
Comment 14 Joel Madero 2014-02-27 22:55:15 UTC
In order to limit the confusion between ProposedEasyHack and EasyHack and to make queries much easier we are changing ProposedEasyHack to NeedsDevEval.

Thank you and apologies for the noise
Comment 15 Commit Notification 2014-03-01 11:57:50 UTC
Rachit Gupta committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=55eb86699d7d4b2151530e9a0b3ca2e99033595b

fdo#74064 The filename gets properly highlighted in the Save As dialog.



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 16 Joel Madero 2014-03-01 16:34:36 UTC
@Rachit - thanks! Going to test it out as soon as I can get this build done
Comment 17 Joel Madero 2014-03-02 02:48:28 UTC
Verified :)
Comment 18 Rachit Gupta 2014-03-02 13:24:04 UTC
Thanks Joel :)
Comment 19 Kohei Yoshida (inactive) 2014-03-21 18:55:08 UTC
This change causes regression I just noticed.  Filed Bug 76466.
Comment 20 Kohei Yoshida (inactive) 2014-03-21 18:59:10 UTC
Judging by the situation, perhaps this bug should have been fixed on the GTK3 side?
Comment 21 Commit Notification 2014-03-21 19:10:35 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9dc4377c91b00585519abfd4fc1528393fe84e4a

Revert "fdo#74064 The filename gets properly highlighted in the Save As dialog."



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 22 Kohei Yoshida (inactive) 2014-03-21 19:11:26 UTC
Sorry.  I have to conclude that this is not a right fix.  Simply ignoring our auto extension flag for the GTK dialog has other consequences.

I would still explore the avenue that perhaps this is a bug in the GTK file picker itself, not ours.
Comment 23 Kohei Yoshida (inactive) 2014-03-21 19:17:05 UTC
(In reply to comment #22)
> Sorry.  I have to conclude that this is not a right fix.  Simply ignoring
> our auto extension flag for the GTK dialog has other consequences.
> 
> I would still explore the avenue that perhaps this is a bug in the GTK file
> picker itself, not ours.

Either that, or perhaps look into whether or not we can control selection of file name in the GTK file chooser dialog, and try to fix this there if that's the case.
Comment 24 Rachit Gupta 2014-03-22 03:18:00 UTC
No problems. If this was not the right fix, it's good that it is reverted. I'll try to work on the right fix :)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.