summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-30 20:02:33 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-30 20:02:33 (GMT)
commit893b73211c822da5e4cb1dcb5946ec58fc0c8dc6 (patch)
treeae11cb42093190a236687704101750d966cffaff /src
parent9155bb1413c8818d4283825a80650cfa978ff47c (diff)
parent40e01de16235f523e020e641b77d0618117706d9 (diff)
downloadQt-893b73211c822da5e4cb1dcb5946ec58fc0c8dc6.zip
Qt-893b73211c822da5e4cb1dcb5946ec58fc0c8dc6.tar.gz
Qt-893b73211c822da5e4cb1dcb5946ec58fc0c8dc6.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')
-rw-r--r--src/corelib/tools/qscopedpointer.cpp4
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp6
-rw-r--r--src/gui/text/qtextdocument.cpp9
3 files changed, 8 insertions, 11 deletions
diff --git a/src/corelib/tools/qscopedpointer.cpp b/src/corelib/tools/qscopedpointer.cpp
index e7dd769..b06112d 100644
--- a/src/corelib/tools/qscopedpointer.cpp
+++ b/src/corelib/tools/qscopedpointer.cpp
@@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE
called resource acquisition is initialization(RAII).
QScopedPointer guarantees that the object pointed to will get deleted when
- the current scope dissapears.
+ the current scope disappears.
Consider this function which does heap allocations, and have various exit points:
@@ -227,7 +227,7 @@ QT_BEGIN_NAMESPACE
/*!
\class QScopedArrayPointer
-
+
\brief The QScopedArrayPointer class stores a pointer to a
dynamically allocated array of objects, and deletes it upon
destruction.
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