From 76f82b74780cb252782c31e6e690f8529b43b38f Mon Sep 17 00:00:00 2001 From: axis Date: Thu, 12 Nov 2009 13:45:41 +0100 Subject: Fixed searching and copy/paste from PDF documents. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously copy and paste from PDFs made by Qt would paste garbage into the target document, and searching was not possible. The bug happened because the internal buffer would open its data stream in truncate mode rather than append mode, thereby losing content, and producing a slightly corrupted PDF. Task: QTBUG-4912 Task: QTBUG-3661 RevBy: Trond Kjernåsen (cherry picked from commit f7ee0c9efcb6cb36a95f49bc998524e25480f8ba) --- src/gui/painting/qpdf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index 65e4a1e..b5cf54c 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -141,7 +141,7 @@ namespace QPdf { fileBackingActive(false), handleDirty(false) { - dev->open(QIODevice::ReadWrite); + dev->open(QIODevice::ReadWrite | QIODevice::Append); } ByteStream::ByteStream(bool fileBacking) -- cgit v0.12