Commit 07d335b2 authored by Leandro Melo's avatar Leandro Melo
Browse files

C++: Avoid trying to generate Doxygen when at end of file



Change-Id: I1fc126782bd88dd65ff83f50fc1dcf65e51a37ff
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@nokia.com>
parent 61bb1b9d
......@@ -2307,16 +2307,18 @@ bool CPPEditorWidget::handleDocumentationComment(QKeyEvent *e)
&& cursor.movePosition(QTextCursor::NextCharacter)) {
}
const QString &comment = doxygen.generate(cursor);
if (!comment.isEmpty()) {
cursor.beginEditBlock();
cursor.setPosition(pos);
cursor.insertText(comment);
cursor.setPosition(pos - 3, QTextCursor::KeepAnchor);
indent(document(), cursor, QChar::Null);
cursor.endEditBlock();
e->accept();
return true;
if (!cursor.atEnd()) {
const QString &comment = doxygen.generate(cursor);
if (!comment.isEmpty()) {
cursor.beginEditBlock();
cursor.setPosition(pos);
cursor.insertText(comment);
cursor.setPosition(pos - 3, QTextCursor::KeepAnchor);
indent(document(), cursor, QChar::Null);
cursor.endEditBlock();
e->accept();
return true;
}
}
cursor.setPosition(pos);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment