Bug 207214 - Overwriting an open file with itself causes Okular to destroy the file
Summary: Overwriting an open file with itself causes Okular to destroy the file
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR grave
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 206271 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-09-13 00:09 UTC by Alec Moskvin
Modified: 2009-09-13 23:33 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alec Moskvin 2009-09-13 00:09:55 UTC
Version:           0.9.1 (using 4.3.1 (KDE 4.3.1), Gentoo)
Compiler:          i686-pc-linux-gnu-gcc
OS:                Linux (i686) release 2.6.31

Steps to reproduce:
1. Open a PDF file on your hard drive with Okular.
2. Select File > Save as...
3. Select the file that is opened
4. Click OK to overwrite.

Result:
- The open document disappears, resulting in a gray box.
- The document becomes either an empty file or contains a few bytes

This is really bad because I needed to fill out a document with forms, and once I did, I wanted to save it. Instead, it destroyed it.
Comment 1 FiNeX 2009-09-13 15:10:34 UTC
Confirmed in trunk r1022847.
Comment 2 Albert Astals Cid 2009-09-13 23:11:39 UTC
SVN commit 1023085 by aacid:

Remove special casing for saving local files where we don't use the temporary file, fixes saving a pdf file over itself
BUGS: 207214


 M  +18 -36    part.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1023085
Comment 3 Albert Astals Cid 2009-09-13 23:23:37 UTC
*** Bug 206271 has been marked as a duplicate of this bug. ***
Comment 4 Alec Moskvin 2009-09-13 23:33:43 UTC
Thank you!