summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-20 20:07:04 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-11-20 20:09:10 (GMT)
commit7367a12c4a0d7686b9d35778e5de33a463504d75 (patch)
tree0cc2e7c2566b3019e91045277ba13658d81a42ab
parent68595bbc28ba0d1cd78557c61011dc004a4a507c (diff)
downloadQt-7367a12c4a0d7686b9d35778e5de33a463504d75.zip
Qt-7367a12c4a0d7686b9d35778e5de33a463504d75.tar.gz
Qt-7367a12c4a0d7686b9d35778e5de33a463504d75.tar.bz2
fix crash on closing "rightmost" file
"This cannot happen" ... yeah, right. :} Task-number: QTBUG-5989
-rw-r--r--tools/linguist/linguist/messageeditor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/linguist/linguist/messageeditor.cpp b/tools/linguist/linguist/messageeditor.cpp
index 616bb26..a7cc636 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