summaryrefslogtreecommitdiff
path: root/src/plugins/qmljseditor/qmlexpressionundercursor.cpp
diff options
context:
space:
mode:
authorChristian Kamm <christian.d.kamm@nokia.com>2011-11-03 13:47:03 +0100
committerChristian Kamm <christian.d.kamm@nokia.com>2011-11-08 09:05:12 +0100
commit386fc347d7baeeddfce1377da646714d43e32acb (patch)
tree8f3975801e2733c752d1d836331dba34a4357818 /src/plugins/qmljseditor/qmlexpressionundercursor.cpp
parent86f0f93033a21c7f64cb1ab04d3650503bf577a9 (diff)
downloadqt-creator-386fc347d7baeeddfce1377da646714d43e32acb.tar.gz
QmlJS: Make Document::Ptr point to a const Document.
Change-Id: I15a36c3f918c0ee16f30bc8366df505e0afac949 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
Diffstat (limited to 'src/plugins/qmljseditor/qmlexpressionundercursor.cpp')
-rw-r--r--src/plugins/qmljseditor/qmlexpressionundercursor.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/qmljseditor/qmlexpressionundercursor.cpp b/src/plugins/qmljseditor/qmlexpressionundercursor.cpp
index 60e90b60de..686ed040c8 100644
--- a/src/plugins/qmljseditor/qmlexpressionundercursor.cpp
+++ b/src/plugins/qmljseditor/qmlexpressionundercursor.cpp
@@ -136,9 +136,11 @@ QmlJS::AST::ExpressionNode *QmlExpressionUnderCursor::operator()(const QTextCurs
ExpressionUnderCursor expressionUnderCursor;
_text = expressionUnderCursor(cursor);
- exprDoc = Document::create(QLatin1String("<expression>"), Document::JavaScriptLanguage);
- exprDoc->setSource(_text);
- exprDoc->parseExpression();
+ Document::MutablePtr newDoc = Document::create(
+ QLatin1String("<expression>"), Document::JavaScriptLanguage);
+ newDoc->setSource(_text);
+ newDoc->parseExpression();
+ exprDoc = newDoc;
_expressionNode = exprDoc->expression();