summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocument.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-11-11 15:38:00 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-11-11 15:44:51 (GMT)
commit06baf7f173b0331a5192616b8ecf9611130f278b (patch)
treecef1740eabeb5213a82290ad80144954d29cf908 /src/gui/text/qtextdocument.cpp
parent223b5de63e56c6c3dfbc5000b460baa653ab3f75 (diff)
downloadQt-06baf7f173b0331a5192616b8ecf9611130f278b.zip
Qt-06baf7f173b0331a5192616b8ecf9611130f278b.tar.gz
Qt-06baf7f173b0331a5192616b8ecf9611130f278b.tar.bz2
Printing QTextDocument doesn't include custom objects.
We need to copy the abstract text layout's custom object handlers as well when we temporarily use a different QTextDocument. Task-number: QTBUG-5397 Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/gui/text/qtextdocument.cpp')
-rw-r--r--src/gui/text/qtextdocument.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 1aad385..048325c 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -64,6 +64,7 @@
#include "qtextdocument_p.h"
#include <private/qprinter_p.h>
+#include <private/qabstracttextdocumentlayout_p.h>
#include <limits.h>
@@ -1722,6 +1723,9 @@ void QTextDocument::print(QPrinter *printer) const
QAbstractTextDocumentLayout *layout = doc->documentLayout();
layout->setPaintDevice(p.device());
+ // copy the custom object handlers
+ layout->d_func()->handlers = documentLayout()->d_func()->handlers;
+
int dpiy = p.device()->logicalDpiY();
int margin = 0;
if (printer->fullPage() && !printer->d_func()->hasCustomPageMargins) {