diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-08-18 11:04:06 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2011-08-19 09:17:03 +0200 |
commit | 28f1c1b9ef10fc3a49a64a535c7747a009939453 (patch) | |
tree | 7b8211a4130804ccf7f1210da003eb2792e15fde /src/widgets | |
parent | 6d2c5d9ffe255410c34edbb1c1228e68c9d745bd (diff) |
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 <qt_sanity_bot@ovi.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/widgets/qwidgettextcontrol.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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<QTextDocument *>(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; } |