From a29539f9c50f3bf12a902e34c37ac34f579b2b74 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Tue, 26 Aug 2014 12:06:56 +0200 Subject: [PATCH] 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 --- src/plugins/cppeditor/cppuseselectionsupdater.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cppuseselectionsupdater.cpp b/src/plugins/cppeditor/cppuseselectionsupdater.cpp index b2ceccfcdb7..f77b9efc6a3 100644 --- a/src/plugins/cppeditor/cppuseselectionsupdater.cpp +++ b/src/plugins/cppeditor/cppuseselectionsupdater.cpp @@ -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(textDocument()->revision())) + if (!document) + return; + + if (semanticInfo.revision != static_cast(textDocument()->revision())) return; QTC_ASSERT(document->translationUnit(), return);