C++ editor: Fix performance problem when using the mouse to find links.

It is unnecessary to try hard to resolve a class forward declaration
when all you want to know is whether it is a valid link or not.

Task-number: QTCREATORBUG-2688
Reviewed-by: Thorbjorn Lindeijer
This commit is contained in:
Christian Kamm
2010-10-11 14:45:58 +02:00
parent e46a99bcc0
commit 22130aae27

View File

@@ -1313,10 +1313,10 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor,
if (def == lastVisibleSymbol)
def = 0; // jump to declaration then.
}
if (symbol->isForwardClassDeclaration()) {
def = snapshot.findMatchingClassDeclaration(symbol);
if (symbol->isForwardClassDeclaration()) {
def = snapshot.findMatchingClassDeclaration(symbol);
}
}
link = linkToSymbol(def ? def : symbol);