Bug 157167 - Saving file.docx as file.odt fails and creates a file.odt.docx if user types quickly (kf5)
Summary: Saving file.docx as file.odt fails and creates a file.odt.docx if user types ...
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.0.3 release
Hardware: x86-64 (AMD64) Linux (All)
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: implementationError
Depends on:
Blocks: KDE, KF5
  Show dependency treegraph
 
Reported: 2023-09-09 13:21 UTC by Atramenta
Modified: 2023-10-25 16:01 UTC (History)
4 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 Atramenta 2023-09-09 13:21:35 UTC
Description:
When saving a .docx file to .odt, if the user quickly types the name and extension (file.odt) and hits enter, LibreOffice fails to detect the format change and instead keeps the docx format and extension, resulting in the file being saved as file.odt.docx, in Word format.

If the user waits for a second before pressing enter, after typing file.odt, the file is correctly saved as file.odt in OpenDocument format.

Steps to Reproduce:
1. Open a docx file with LibreOffice Writer
2. Click File > Save as. 
3. Enter the filename file.odt and immediately hit enter to confirm

Actual Results:
File is saved as file.odt.docx and is in Word format

Expected Results:
File should be saved as file.odt and be in OpenDocument format


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 7.4.6.2 / LibreOffice Community
Build ID: 5b1f5509c2decdade7fda905e3e1429a67acd63d
CPU threads: 8; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fr-FR (en_US.UTF-8); UI: fr-FR
Calc: threaded
Comment 1 Atramenta 2023-09-11 17:15:59 UTC
Correction : the file saved file.odt.docx is in OpenDocument format.
The problem is only that it is saved with an extra and incorrect .docx extension.
Comment 2 Dieter 2023-09-26 06:43:11 UTC
At least with Windows dialog and with LO dialog it is the expected behaviour, if you don't change save file type from docx to odt. But I don't know the Linux dialog.
Comment 3 Stéphane Guillou (stragu) 2023-09-27 20:55:37 UTC
Can't reproduce with:

Version: 7.4.7.2 / LibreOffice Community
Build ID: 723314e595e8007d3cf785c16538505a1c878ca5
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Neither with kf5 VCL plugin:

Version: 7.4.7.2 / LibreOffice Community
Build ID: 723314e595e8007d3cf785c16538505a1c878ca5
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

I end up with file.odt as expected.

(The one odd thing I noticed was that the warning about using DOCX pops up even though the resulting file is ODT.)

In any case, 7.4 won't see further updates, so can you please test again with LO 7.5 or 7.6?

Thank you!
Comment 4 Atramenta 2023-10-11 22:20:11 UTC
Still happening on:


Version: 7.5.7.1 (X86_64) / LibreOffice Community
Build ID: 47eb0cf7efbacdee9b19ae25d6752381ede23126
CPU threads: 8; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fr-FR (en_US.UTF-8); UI: fr-FR
Calc: threaded

- I opened a docx document with LibreOffice Writer
- I clicked File > Save as (Fichier > Enregistrer sous, with the french UI)
- In the file dialog I removed the .docx extension from the filename, then quickly typed .odt and pressed enter.
- The file was saved as file.odt.docx
- The file "file.odt.docx" is actually an OpenDocument file

If I do the exact them thing, slowly, the file is saved as "file.odt"
Comment 5 QA Administrators 2023-10-12 03:17:30 UTC Comment hidden (obsolete)
Comment 6 Stéphane Guillou (stragu) 2023-10-12 08:42:30 UTC
I still can't reproduce.
Can you please test in a different application that uses the same save dialog? Wondering if this is an issue with the desktop environment rather than LibreOffice.
Are you using KDE?
Comment 7 Atramenta 2023-10-12 11:05:23 UTC
(In reply to Stéphane Guillou (stragu) from comment #6)
> I still can't reproduce.
> Can you please test in a different application that uses the same save
> dialog? Wondering if this is an issue with the desktop environment rather
> than LibreOffice.
> Are you using KDE?

Yes, I'm using KDE on an up to date KDE Neon system.
I've tried the "Save as" function in Firefox, but couldn't reproduce the problem there. When I quickly entered a different file extension instead of the default "file.html" and pressed enter, the resulting file was correctly saved as a text file named "file.txt"

Can you suggest a specific application that might trigger the same bug in the "Save as" dialog presented by KDE?
Comment 8 QA Administrators 2023-10-13 03:16:36 UTC Comment hidden (obsolete)
Comment 9 Buovjaga 2023-10-25 11:38:16 UTC
Reproduced, all the way to 7.0. In 6.4 I got LibreOffice internal dialogs, so probably back then the KDE file dialogs were not implemented yet.

Arch Linux 64-bit, X11
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 9704f61982360ce35983a61cca3fd00bbdf51ab6
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 25 October 2023
Comment 10 Michael Weghorn 2023-10-25 16:01:21 UTC
(In reply to Stéphane Guillou (stragu) from comment #6)
> Wondering if this is an issue with the desktop environment rather
> than LibreOffice.

Indeed, sounds like an issue with the KDE-specific QFileDialog/KFileWidget.

(In reply to Atramenta from comment #7)
> Can you suggest a specific application that might trigger the same bug in
> the "Save as" dialog presented by KDE?

I can reproduce something slightly different, but similar, with Calligra (calligrasheets, the spreadsheet application):

* create a new file
* "File" -> "Save as"
* for "Filter", select "ODS spreadsheet"
* in the "Name" field, type "test.htm" and hit Enter quickly

-> The file gets saved in ODS format as "test.htm.ods"

If you wait a second before hitting Enter, the behavior is different. I get a dialog asking whether I actually want to save in HTML format, since that's lossy. (And when I select OK, I get an error, but that's probably a different issue in Calligra....).

Since this seems to be an issue of KFileWidget, I'm closing this as NOTOURBUG.

Please report it in KDE Bugzilla instead (and ideally paste a link here): https://bugs.kde.org
(Component is probably "frameworks-kio")

If there's any feedback there that suggests there's still anything to do on LibreOffice side, please let us now.