summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextcontrol.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-08-16 14:04:48 +0200
committerLars Knoll <lars.knoll@nokia.com>2011-08-19 09:16:22 +0200
commit699e8fe3a6724dd8288dd6a55b25e070eb198c9d (patch)
treec6928eb3928f2e687e4050e9f409a0afa2e7828a /src/gui/text/qtextcontrol.cpp
parent9ebdc333a6a6485fd60a50a742a1d6edec211f53 (diff)
Use the paged paintdevice in the print() method of QTextDocument.
This is required to be able to move the printing system into it's own library. Change-Id: If70a55be4c4413f9cd917a30d1b368f32c1145e4 Reviewed-on: http://codereview.qt.nokia.com/3207 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/gui/text/qtextcontrol.cpp')
-rw-r--r--src/gui/text/qtextcontrol.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 689fd4379b..0a4b61f414 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -60,6 +60,7 @@
#include "qprinter.h"
#include "qtextdocumentwriter.h"
#include "private/qtextcursor_p.h"
+#include "qpagedpaintdevice.h"
#include <qtextformat.h>
#include <qdatetime.h>
@@ -2230,15 +2231,15 @@ bool QTextControl::isWordSelectionEnabled() const
return d->wordSelectionEnabled;
}
-#ifndef QT_NO_PRINTER
-void QTextControl::print(QPrinter *printer) const
+void QTextControl::print(QPagedPaintDevice *printer) const
{
-#ifndef QT_NO_PRINTER
Q_D(const QTextControl);
- if (!printer || !printer->isValid())
+ if (!printer)
return;
QTextDocument *tempDoc = 0;
const QTextDocument *doc = d->doc;
+ // ####
+#if 0
if (printer->printRange() == QPrinter::Selection) {
if (!d->cursor.hasSelection())
return;
@@ -2253,11 +2254,10 @@ void QTextControl::print(QPrinter *printer) const
// copy the custom object handlers
doc->documentLayout()->d_func()->handlers = d->doc->documentLayout()->d_func()->handlers;
}
+#endif
doc->print(printer);
delete tempDoc;
-#endif
}
-#endif // QT_NO_PRINTER
QMimeData *QTextControl::createMimeDataFromSelection() const
{