summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-30 13:19:57 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-30 13:19:57 (GMT)
commit40e01de16235f523e020e641b77d0618117706d9 (patch)
tree74f751e221ff714ddc4fc18cb327f08c61238dba /src/gui
parent096474565f9683515dddb7175bb64a77d9f805f2 (diff)
parent7fac03fc111f0c5938eff80f96d25c03c70c4040 (diff)
downloadQt-40e01de16235f523e020e641b77d0618117706d9.zip
Qt-40e01de16235f523e020e641b77d0618117706d9.tar.gz
Qt-40e01de16235f523e020e641b77d0618117706d9.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fixed a leak in QTextDocument::print(). Ensured that WA_InputMethodEnabled was set before FocusInEvent was sent.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp6
-rw-r--r--src/gui/text/qtextdocument.cpp9
2 files changed, 6 insertions, 9 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index b368a82..98fc10f 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -808,13 +808,13 @@ void QGraphicsScenePrivate::setFocusItemHelper(QGraphicsItem *item,
#endif //QT_NO_IM
}
- if (item) {
+ if (item)
focusItem = item;
+ updateInputMethodSensitivityInViews();
+ if (item) {
QFocusEvent event(QEvent::FocusIn, focusReason);
sendEvent(item, &event);
}
-
- updateInputMethodSensitivityInViews();
}
/*!
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index f5d322a..1677ee6 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -1679,7 +1679,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);
@@ -1712,7 +1712,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();
@@ -1787,7 +1787,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();
@@ -1807,9 +1807,6 @@ void QTextDocument::print(QPrinter *printer) const
if ( i < docCopies - 1)
printer->newPage();
}
-
-UserCanceled:
- delete clonedDoc;
}
#endif