diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-11-20 20:07:04 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-11-23 10:59:43 (GMT) |
commit | 80070cf35554656f48ce23f33bcaaf8534fd1dba (patch) | |
tree | 4321ecd662efdac00f50ab1b04a3fc65748d5278 /tools/linguist | |
parent | fb65db54eb502f773eaa402e3aabfada585c4fd6 (diff) | |
download | Qt-80070cf35554656f48ce23f33bcaaf8534fd1dba.zip Qt-80070cf35554656f48ce23f33bcaaf8534fd1dba.tar.gz Qt-80070cf35554656f48ce23f33bcaaf8534fd1dba.tar.bz2 |
fix crash on closing "rightmost" file
"This cannot happen" ... yeah, right. :}
Task-number: QTBUG-5989
(cherry picked from commit 7367a12c4a0d7686b9d35778e5de33a463504d75)
Diffstat (limited to 'tools/linguist')
-rw-r--r-- | tools/linguist/linguist/messageeditor.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/linguist/linguist/messageeditor.cpp b/tools/linguist/linguist/messageeditor.cpp index 2500e4b..895d292 100644 --- a/tools/linguist/linguist/messageeditor.cpp +++ b/tools/linguist/linguist/messageeditor.cpp @@ -407,10 +407,12 @@ QTextEdit *MessageEditor::activeTranslation() const { if (m_currentNumerus < 0) return 0; - foreach (QTextEdit *te, m_editors[m_currentModel].transTexts[m_currentNumerus]->getEditors()) + const QList<FormatTextEdit *> &editors = + m_editors[m_currentModel].transTexts[m_currentNumerus]->getEditors(); + foreach (QTextEdit *te, editors) if (te->hasFocus()) return te; - return 0; // This cannot happen + return editors.first(); } QTextEdit *MessageEditor::activeOr1stTranslation() const |