summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-01 01:03:52 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-01 01:03:52 (GMT)
commit275f0a48e3fdbf21f73956d8a7a8348228fca5b2 (patch)
treeae11cb42093190a236687704101750d966cffaff /src/gui
parent9155bb1413c8818d4283825a80650cfa978ff47c (diff)
parent893b73211c822da5e4cb1dcb5946ec58fc0c8dc6 (diff)
downloadQt-275f0a48e3fdbf21f73956d8a7a8348228fca5b2.zip
Qt-275f0a48e3fdbf21f73956d8a7a8348228fca5b2.tar.gz
Qt-275f0a48e3fdbf21f73956d8a7a8348228fca5b2.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