C++: set the document field in the synchronous case.

Task-number: QTCREATORBUG-12975
Change-Id: I9a4b8c69e925e288b7b02263c27f9791748bac85
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Erik Verbruggen
2014-09-05 13:36:59 +02:00
committed by Nikolai Kosjar
parent 8b8911e899
commit bf33b41da8

View File

@@ -359,6 +359,8 @@ void CppUseSelectionsUpdater::handleSymbolCaseAsynchronously(const Document::Ptr
void CppUseSelectionsUpdater::handleSymbolCaseSynchronously(const Document::Ptr document,
const Snapshot &snapshot)
{
m_document = document;
const Params params = Params(m_editorWidget->textCursor(), document, snapshot);
const UseSelectionsResult result = findUses(params);
processSymbolCaseResults(result);
@@ -419,6 +421,9 @@ ExtraSelections CppUseSelectionsUpdater::toExtraSelections(const QList<int> &ref
TextEditor::TextStyle style) const
{
ExtraSelections selections;
QTC_ASSERT(m_document, return selections);
foreach (int index, references) {
unsigned line, column;
TranslationUnit *unit = m_document->translationUnit();