Bug 207214

Summary: Overwriting an open file with itself causes Okular to destroy the file
Product: [Applications] okular Reporter: Alec Moskvin <alecm>
Component: generalAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: grave CC: Cobra176, finex
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

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!