Fix insert position for refactoring getter and setter functions

If the cpp file had unsaved changes (newlines at top or in the middle)
the inserted getter and setter functions were misplaced.

Change-Id: I15129df2c0bdb91e6fb5e22213e7b4f52733c6ae
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Lorenz Haas
2013-04-04 20:44:39 +02:00
committed by hjk
parent adc7d65ca6
commit 4f1e892feb

View File

@@ -567,7 +567,7 @@ public:
CppRefactoringChanges implRefactoring(snapshot()); CppRefactoringChanges implRefactoring(snapshot());
CppRefactoringFilePtr implFile = implRefactoring.file(implFileName); CppRefactoringFilePtr implFile = implRefactoring.file(implFileName);
ChangeSet implChanges; ChangeSet implChanges;
const int implInsertPos = QFileInfo(implFileName).size(); const int implInsertPos = implFile->document()->characterCount() - 1;
implChanges.insert(implInsertPos, implementation); implChanges.insert(implInsertPos, implementation);
implFile->setChangeSet(implChanges); implFile->setChangeSet(implChanges);
implFile->appendIndentRange( implFile->appendIndentRange(