Generalized the changeset operations.

This commit is contained in:
Roberto Raggi
2010-06-22 10:14:06 +02:00
parent b13d6ae362
commit eb749ec3a2
9 changed files with 121 additions and 187 deletions

View File

@@ -103,7 +103,7 @@ void ComponentFromObjectDef::createChanges()
const QString txt = imports + textOf(start, end) + QLatin1String("}\n");
Utils::ChangeSet changes;
changes.replace(start, end - start, componentName + QLatin1String(" {\n"));
changes.replace(start, end, componentName + QLatin1String(" {\n"));
qmljsRefactoringChanges()->changeFile(fileName(), changes);
qmljsRefactoringChanges()->reindent(fileName(), range(start, end + 1));

View File

@@ -880,7 +880,7 @@ void QmlJSTextEditor::renameIdUnderCursor()
Utils::ChangeSet changeSet;
foreach (const AST::SourceLocation &loc, m_semanticInfo.idLocations.value(id)) {
changeSet.replace(loc.offset, loc.length, newId);
changeSet.replace(loc.begin(), loc.end(), newId);
}
QTextCursor tc = textCursor();