OSDN Git Service

Code assist: Fix doxygen completion
authorLeandro Melo <leandro.melo@nokia.com>
Wed, 14 Sep 2011 14:22:45 +0000 (16:22 +0200)
committerLeandro T. C. Melo <leandro.melo@nokia.com>
Thu, 15 Sep 2011 07:10:32 +0000 (09:10 +0200)
When the assist interface is detached the correct thing to do
is to clone the document, not simply to copy the text content.
Then data like the user state is preserved.

For the particular issue below, the problem is that the simple
lexer doesn't have the correct initial state and thus cannot
identify its inside a comment.

Task-number: QTCREATORBUG-6061
Change-Id: I59380eeb229e322bafb1e799d649df90327c0f54
Reviewed-on: http://codereview.qt-project.org/4912
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
src/plugins/texteditor/codeassist/defaultassistinterface.cpp

index 1bd9f46..84a5eca 100644 (file)
@@ -69,7 +69,7 @@ QString DefaultAssistInterface::textAt(int pos, int length) const
 
 void DefaultAssistInterface::detach(QThread *destination)
 {
-    m_document = new QTextDocument(m_document->toPlainText());
+    m_document = m_document->clone();
     m_document->moveToThread(destination);
     m_detached = true;
 }