Bug Hunting Session
Bug 111070 - Saving file with a different LO-recognized file extension does not add correct extension
Summary: Saving file with a different LO-recognized file extension does not add correc...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: File-Dialog
  Show dependency treegraph
 
Reported: 2017-08-01 21:56 UTC by Aron Budea
Modified: 2019-08-26 03:32 UTC (History)
3 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 Aron Budea 2017-08-01 21:56:42 UTC
This issue might be Windows-only.

- For reference, save a new file without extension (eg. "abcd"), with default, ODT type.

=> Correctly, ".odt" extension is added, so the file is named "abcd.odt".

- Another correct example, save it with a bogus extension (eg. "abcd.12").

=> Correctly, ".odt" extension is added, so the file is named "abcd.12.odt".

- Now save it with the name "abcd.doc" (don't change type).

=> ".odf" extension is not added, file is saved with the name "abcd.doc", but in ODF format, which is bad.

I could imagine the behavior depending on "Automatic file name extension" (the setting is Win-only, though), but it wasn't touched, and it's checked the whole time.

Observed with LO 5.4.0.3 & 3.3.0 / Windows 7.
Comment 1 Aron Budea 2017-08-01 22:05:31 UTC
This explains Samuel's observation in bug 57860 comment 1 (123 is Lotus 1-2-3 extension).
Comment 2 Timur 2017-08-02 07:20:58 UTC
Right, annoying, congrats you reported. 
Not sure how Linux sets filetype right, but I mark as Windows-only bug.
Comment 3 Aron Budea 2017-08-02 15:55:18 UTC
Timur, I'm changing the summary back to the original if you don't mind. My expectation is not that it should save with the type corresponding to the extension (this has been dismissed in bug 93199), but the opposite:
It should append the extension corresponding to the selected type if "Automatic file name extension" is checked.
Comment 4 Yousuf Philips (jay) (retired) 2017-08-02 16:25:59 UTC
(In reply to Aron Budea from comment #0)
> - Now save it with the name "abcd.doc" (don't change type).
> 
> => ".odf" extension is not added, file is saved with the name "abcd.doc",
> but in ODF format, which is bad.

So you expect it to have saved it to abcd.doc.odf?
Comment 5 Aron Budea 2017-08-02 16:51:25 UTC
(In reply to Yousuf Philips (jay) from comment #4)
> So you expect it to have saved it to abcd.doc.odf?

Yes, it might not be what the user wanted to happen, as they might've expected to change the file type, but the behavior would be clear.
Comment 6 Yousuf Philips (jay) (retired) 2017-08-02 16:54:01 UTC
(In reply to Aron Budea from comment #5)
> Yes, it might not be what the user wanted to happen, as they might've
> expected to change the file type, but the behavior would be clear.

I would think it would be a bad thing to do this, as extensions on windows are hidden by default and users would only see 'abcd.doc' and assume it was a '.doc' file. Instead it should replace the extension and be 'abcd.odf', if we agree that filetype selection should overwrite what users type or select as the filename.
Comment 7 Aron Budea 2017-08-03 03:18:21 UTC
(In reply to Yousuf Philips (jay) from comment #6)
> I would think it would be a bad thing to do this, as extensions on windows
> are hidden by default and users would only see 'abcd.doc' and assume it was
> a '.doc' file. Instead it should replace the extension and be 'abcd.odf', if
> we agree that filetype selection should overwrite what users type or select
> as the filename.

And I would be extremely careful with changing what the user has input... Appending the extension of the selected type is the normal behavior, this is just a matter of being consistent.

You could consider adding a warning dialog that lets the user know the file is saved with the selected type instead of what corresponds to the manually typed extension, maybe even let the user choose.

I'd say this is something that can be considered for the future, but as an immediate fix to the current situation, which is absolutely wrong, adding the correct extension would be enough.
Comment 8 QA Administrators 2018-08-04 02:38:28 UTC Comment hidden (obsolete)
Comment 9 Joao Farias 2018-08-07 20:29:08 UTC
Still reproducible.

Version: 6.1.0.2 (x64)
Build ID: b3972dcf1284967612d5ee04fea9d15bcf0cc106
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: en-US (en_US); Calc: group threaded
Comment 10 Aron Budea 2018-08-07 21:13:16 UTC Comment hidden (obsolete)
Comment 11 QA Administrators 2019-08-19 06:57:43 UTC Comment hidden (obsolete)
Comment 12 Aron Budea 2019-08-26 00:02:32 UTC
Still occurs in LO 6.4.0.0.alpha0+ (d3d13140f0036c53aa74820b41acfeffa3572168) / Windows 7.