Clang: Remove dead code

Change-Id: I609929ca7723c60e108e30b7789c4482ebff7228
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Robert Loehning
2018-02-12 18:53:44 +01:00
parent 9f06af8dc2
commit 1fcd494cc7

View File

@@ -58,7 +58,6 @@ void ClangPreprocessorAssistProposalItem::apply(TextEditor::TextDocumentManipula
QString extraCharacters;
int extraLength = 0;
int cursorOffset = 0;
if (isInclude()) {
if (!textToBeInserted.endsWith(QLatin1Char('/'))) {
@@ -69,11 +68,8 @@ void ClangPreprocessorAssistProposalItem::apply(TextEditor::TextDocumentManipula
}
}
if (!m_typedCharacter.isNull()) {
if (!m_typedCharacter.isNull())
extraCharacters += m_typedCharacter;
if (cursorOffset != 0)
--cursorOffset;
}
// Avoid inserting characters that are already there
const int endsPosition = manipulator.positionAt(TextEditor::EndOfLinePosition);
@@ -101,9 +97,7 @@ void ClangPreprocessorAssistProposalItem::apply(TextEditor::TextDocumentManipula
// Insert the remainder of the name
const int length = manipulator.currentPosition() - basePosition + existLength + extraLength;
const bool isReplaced = manipulator.replace(basePosition, length, textToBeInserted);
if (isReplaced && cursorOffset)
manipulator.setCursorPosition(manipulator.currentPosition() + cursorOffset);
manipulator.replace(basePosition, length, textToBeInserted);
}
void ClangPreprocessorAssistProposalItem::setText(const QString &text)