QmlDesigner: Fix remove imports in the Rewriter

The import should be removed and not the import list.

Change-Id: I6d9017141ea9c0d5885ed6d3dc3d227c2fe7b2f4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Marco Bubke
2013-08-12 16:17:49 +02:00
parent b488d97594
commit 662df29efa

View File

@@ -79,8 +79,8 @@ bool ChangeImportsVisitor::remove(QmlJS::AST::UiProgram *ast, const Import &impo
for (UiImportList *iter = ast->imports; iter; iter = iter->next) {
if (equals(iter->import, import)) {
int start = iter->firstSourceLocation().begin();
int end = iter->lastSourceLocation().end();
int start = iter->import->firstSourceLocation().begin();
int end = iter->import->lastSourceLocation().end();
includeSurroundingWhitespace(start, end);
replace(start, end - start, QString());
setDidRewriting(true);