summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextcontrol.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/qtextcontrol.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/qtextcontrol.cpp')
-rw-r--r--src/gui/text/qtextcontrol.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 9497b6f..62039f3 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -55,6 +55,7 @@
#include <qstyle.h>
#include <qtimer.h>
#include "private/qtextdocumentlayout_p.h"
+#include "private/qabstracttextdocumentlayout_p.h"
#include "private/qtextedit_p.h"
#include "qtextdocument.h"
#include "private/qtextdocument_p.h"
@@ -2313,6 +2314,9 @@ void QTextControl::print(QPrinter *printer) const
tempDoc->setUseDesignMetrics(doc->useDesignMetrics());
QTextCursor(tempDoc).insertFragment(d->cursor.selection());
doc = tempDoc;
+
+ // copy the custom object handlers
+ doc->documentLayout()->d_func()->handlers = d->doc->documentLayout()->d_func()->handlers;
}
doc->print(printer);
delete tempDoc;