QmlJsDelta: When coputing the debug ids, we need to do it on the original document.

Else, the line numbers does not match anymore.
This commit is contained in:
Olivier Goffart
2010-07-16 16:37:40 +02:00
parent 4b504323ec
commit c1d681811a
5 changed files with 22 additions and 7 deletions

View File

@@ -98,7 +98,7 @@ void QmlJSLiveTextPreview::unassociateEditor(Core::IEditor *oldEditor)
}
QmlJSLiveTextPreview::QmlJSLiveTextPreview(QmlJS::Document::Ptr doc, QObject *parent) :
QObject(parent), m_previousDoc(doc)
QObject(parent), m_previousDoc(doc), m_initialDoc(doc)
{
ClientProxy *clientProxy = ClientProxy::instance();
m_filename = doc->fileName();
@@ -177,7 +177,7 @@ void QmlJSLiveTextPreview::changeSelectedElements(QList<int> offsets, const QStr
void QmlJSLiveTextPreview::updateDebugIds(const QDeclarativeDebugObjectReference &rootReference)
{
QmlJS::Document::Ptr doc = m_previousDoc;
QmlJS::Document::Ptr doc = m_initialDoc;
if (!doc->qmlProgram())
return;
@@ -188,6 +188,9 @@ void QmlJSLiveTextPreview::updateDebugIds(const QDeclarativeDebugObjectReference
doc->qmlProgram()->accept(&visitor);
m_debugIds = visitor.result;
Delta delta;
delta.doNotSendChanges = true;
m_debugIds = delta(doc, m_previousDoc, m_debugIds);
}
void QmlJSLiveTextPreview::documentChanged(QmlJS::Document::Ptr doc)