summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocument.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-05-01 21:38:09 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-05-01 21:38:09 (GMT)
commit1d021032f6920fe90bc23a028ae15ab434868363 (patch)
treed03fbde992158177aeb22d83e0412c58f189197b /src/gui/text/qtextdocument.cpp
parent36a5ecba6ca65e8445fa9b391e239f62c2002159 (diff)
parentfef0ec67bf1b49221b3f383f6ea1c9a65fc08c57 (diff)
downloadQt-1d021032f6920fe90bc23a028ae15ab434868363.zip
Qt-1d021032f6920fe90bc23a028ae15ab434868363.tar.gz
Qt-1d021032f6920fe90bc23a028ae15ab434868363.tar.bz2
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Diffstat (limited to 'src/gui/text/qtextdocument.cpp')
-rw-r--r--src/gui/text/qtextdocument.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 3e556a7..afba678 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -1704,7 +1704,7 @@ void QTextDocument::print(QPrinter *printer) const
return;
const QTextDocument *doc = this;
- QTextDocument *clonedDoc = 0;
+ QScopedPointer<QTextDocument> clonedDoc;
(void)doc->documentLayout(); // make sure that there is a layout
QRectF body = QRectF(QPointF(0, 0), d->pageSize);
@@ -1737,7 +1737,7 @@ void QTextDocument::print(QPrinter *printer) const
printerPageSize.height() / scaledPageSize.height());
} else {
doc = clone(const_cast<QTextDocument *>(this));
- clonedDoc = const_cast<QTextDocument *>(doc);
+ clonedDoc.reset(const_cast<QTextDocument *>(doc));
for (QTextBlock srcBlock = firstBlock(), dstBlock = clonedDoc->firstBlock();
srcBlock.isValid() && dstBlock.isValid();
@@ -1812,7 +1812,7 @@ void QTextDocument::print(QPrinter *printer) const
for (int j = 0; j < pageCopies; ++j) {
if (printer->printerState() == QPrinter::Aborted
|| printer->printerState() == QPrinter::Error)
- goto UserCanceled;
+ return;
printPage(page, &p, doc, body, pageNumberPos);
if (j < pageCopies - 1)
printer->newPage();
@@ -1832,9 +1832,6 @@ void QTextDocument::print(QPrinter *printer) const
if ( i < docCopies - 1)
printer->newPage();
}
-
-UserCanceled:
- delete clonedDoc;
}
#endif