From 28f1c1b9ef10fc3a49a64a535c7747a009939453 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 18 Aug 2011 11:04:06 +0200 Subject: Restore feature compatibility with QPrinter in QTextDocument::print Add a margin method to QPagedPaintDevice. The other variables required are stored in QPagedPaintDevicePrivate without a public API for now. This needs cleaning up once we have a new printing system. Change-Id: Id3f2d7ac7f3cbce8619072a897d91f3a588add64 Reviewed-on: http://codereview.qt.nokia.com/3211 Reviewed-by: Qt Sanity Bot Reviewed-by: Gunnar Sletta --- src/widgets/widgets/qwidgettextcontrol.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 609a67b27a..f45211c1ff 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -63,6 +63,7 @@ #include "private/qwidgettextcontrol_p.h" #include "qgraphicssceneevent.h" #include "qpagedpaintdevice.h" +#include "private/qpagedpaintdevice_p.h" #include "qtextdocumentwriter.h" #include "private/qtextcursor_p.h" @@ -2430,9 +2431,7 @@ void QWidgetTextControl::print(QPagedPaintDevice *printer) const return; QTextDocument *tempDoc = 0; const QTextDocument *doc = d->doc; -#if 0 - // #### - if (printer->printRange() == QPrinter::Selection) { + if (QPagedPaintDevicePrivate::get(printer)->printSelectionOnly) { if (!d->cursor.hasSelection()) return; tempDoc = new QTextDocument(const_cast(doc)); @@ -2446,7 +2445,6 @@ void QWidgetTextControl::print(QPagedPaintDevice *printer) const // copy the custom object handlers doc->documentLayout()->d_func()->handlers = d->doc->documentLayout()->d_func()->handlers; } -#endif doc->print(printer); delete tempDoc; } -- cgit v1.2.3