CppEditor: Compare semantic info revision in CppUseSelectionsUpdater

...instead of the semantic info *document* revision, which might be
older in case the semantic info was re-used.

This fixes the use selections in case the user triggered the undo action
after some changes in the local renaming mode.

Regression introduced by extraction of the CppUseSelectionsUpdater in

    commit 89bd4ee
    C++: Base parsing on editor document instead of widget

Change-Id: I8f38f6b53c950e25f02675a939876fa3ed0e81f4
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-08-26 12:06:56 +02:00
parent 7bfe231897
commit a29539f9c5

View File

@@ -260,7 +260,10 @@ void CppUseSelectionsUpdater::update(CallType callType)
const Document::Ptr document = semanticInfo.doc;
const Snapshot snapshot = semanticInfo.snapshot;
if (!document || document->editorRevision() != static_cast<unsigned>(textDocument()->revision()))
if (!document)
return;
if (semanticInfo.revision != static_cast<unsigned>(textDocument()->revision()))
return;
QTC_ASSERT(document->translationUnit(), return);