Commit 94747f57 authored by Tommi Asp's avatar Tommi Asp Committed by Leandro Melo
Browse files

C++: Fix while-loop from CppEditorWidget



Caused while to run forever when not checking
cursor.movePosition() return value.

Change-Id: Ie8211a477ab1889d4583d3b01e1a200d9905fd6d
Reviewed-by: default avatarLeandro Melo <leandro.melo@nokia.com>
parent 2b778bc0
......@@ -2303,8 +2303,9 @@ bool CPPEditorWidget::handleDocumentationComment(QKeyEvent *e)
doxygen.setStyle(CppTools::DoxygenGenerator::JavaStyle);
// Move until we reach any possibly meaningful content.
while (document()->characterAt(cursor.position()).isSpace())
cursor.movePosition(QTextCursor::NextCharacter);
while (document()->characterAt(cursor.position()).isSpace()
&& cursor.movePosition(QTextCursor::NextCharacter)) {
}
const QString &comment = doxygen.generate(cursor);
if (!comment.isEmpty()) {
......
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