Bug 119790 - When printing to PDF, existing file with different file name in the target folder gets overwritten (GTK3-only)
Summary: When printing to PDF, existing file with different file name in the target fo...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
6.0.6.2 release
Hardware: All All
: high major
Assignee: Caolán McNamara
URL:
Whiteboard: target:6.2.0 target:6.1.4
Keywords: dataLoss
: 121737 (view as bug list)
Depends on:
Blocks: GTK3
  Show dependency treegraph
 
Reported: 2018-09-10 15:33 UTC by Michael Schönitzer
Modified: 2018-11-30 08:37 UTC (History)
2 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 Michael Schönitzer 2018-09-10 15:33:02 UTC
Description:
In the save-Menu I selected a odt-file and then changed the fileextension in the input-field to pdf. This caused an other totally uninvolved pdf-file to be overwritten.

Happened multiple times to me in the last days. (I lost some data and would have lost a lot more if not for backups!) Seems reproducible on my system.

Libreoffice 6.0.6-3 (x86_64) on Arch Linux

Steps to Reproduce:
1. have a folder with 2 files:
foo.odf
bar.pdf
2. Open foo.odf (in my case a series letter)
3. go to print
4. say yes to I want to do a series letter
5. specify print to file
6. navigate to the folder
7. select "foo.odt" with the mouse and then
8. change the filename in the input-field from "foo.odt" to "foo.pdf" and
9. click on save.

Actual Results:
The file is saved as bar.pdf. The old will get overwritten! The old content is lost.

Expected Results:
The file is saved as foo.pdf. 


Reproducible: Always


User Profile Reset: No



Additional Info:
I don't know if it's limited to series letters and the PDF-Export.
Comment 1 Buovjaga 2018-09-25 18:17:07 UTC
Please copy and paste here the contents of your Help - About. This allows us to know more about your system.

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the information.

Suspecting kde.
Comment 2 Michael Schönitzer 2018-09-25 21:56:11 UTC
Version: 6.0.6.2
Build-ID: 6.0.6-3
CPU-Threads: 4; BS: Linux 4.18; UI-Render: Standard; VCL: gtk3; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group
Comment 3 Buovjaga 2018-09-26 18:38:18 UTC
Holy wow, this is nasty.

The .odt does not need to be a serial letter.

I reproduced by having two files in a folder and doing the steps. Before step 7, one has to change the format to "Any type" in order to be able to select the .odt.

GTK3 is the only VCL backend with this problem.

Arch Linux 64-bit
Version: 6.2.0.0.alpha0+
Build ID: 88e26267844ac96f39d341ef05bd1536f210af74
CPU threads: 8; OS: Linux 4.18; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); Calc: threaded
Built on 25 September 2018
Comment 4 Octavio Alvarez 2018-09-27 00:48:03 UTC
OMG! Repro!

Version: 6.1.1.2
Build ID: 1:6.1.1-1
CPU threads: 4; OS: Linux 4.2; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.utf8); Calc: group threaded
Comment 5 Commit Notification 2018-11-08 12:46:24 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/35b6f75bc14fe65c4700e199d82c958f715420ac%5E%21

Resolves: tdf#119790 for gtk3 save and restore typed name on changing filter

It will be available in 6.2.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 Caolán McNamara 2018-11-08 12:49:12 UTC
6-1 backport in gerrit
Comment 7 Commit Notification 2018-11-27 11:50:13 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

https://git.libreoffice.org/core/+/4846848941241f92b32bcffef3489736d1baffec%5E%21

Resolves: tdf#119790 for gtk3 save and restore typed name on changing filter

It will be available in 6.1.4.

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 8 Caolán McNamara 2018-11-27 14:23:47 UTC
*** Bug 121737 has been marked as a duplicate of this bug. ***
Comment 9 Jean DELVARE 2018-11-30 08:37:10 UTC
(In reply to Commit Notification from comment #7)
> Affected users are encouraged to test the fix and report feedback.

I have backported the fix to the openSUSE package and I can confirm that it works. Thanks.