forked from qt-creator/qt-creator
C++: Fix while-loop from CppEditorWidget
Caused while to run forever when not checking cursor.movePosition() return value. Change-Id: Ie8211a477ab1889d4583d3b01e1a200d9905fd6d Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
@@ -2303,8 +2303,9 @@ bool CPPEditorWidget::handleDocumentationComment(QKeyEvent *e)
|
|||||||
doxygen.setStyle(CppTools::DoxygenGenerator::JavaStyle);
|
doxygen.setStyle(CppTools::DoxygenGenerator::JavaStyle);
|
||||||
|
|
||||||
// Move until we reach any possibly meaningful content.
|
// Move until we reach any possibly meaningful content.
|
||||||
while (document()->characterAt(cursor.position()).isSpace())
|
while (document()->characterAt(cursor.position()).isSpace()
|
||||||
cursor.movePosition(QTextCursor::NextCharacter);
|
&& cursor.movePosition(QTextCursor::NextCharacter)) {
|
||||||
|
}
|
||||||
|
|
||||||
const QString &comment = doxygen.generate(cursor);
|
const QString &comment = doxygen.generate(cursor);
|
||||||
if (!comment.isEmpty()) {
|
if (!comment.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user