forked from qt-creator/qt-creator
Clang: Remove dead code
Change-Id: I609929ca7723c60e108e30b7789c4482ebff7228 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -58,7 +58,6 @@ void ClangPreprocessorAssistProposalItem::apply(TextEditor::TextDocumentManipula
|
|||||||
|
|
||||||
QString extraCharacters;
|
QString extraCharacters;
|
||||||
int extraLength = 0;
|
int extraLength = 0;
|
||||||
int cursorOffset = 0;
|
|
||||||
|
|
||||||
if (isInclude()) {
|
if (isInclude()) {
|
||||||
if (!textToBeInserted.endsWith(QLatin1Char('/'))) {
|
if (!textToBeInserted.endsWith(QLatin1Char('/'))) {
|
||||||
@@ -69,11 +68,8 @@ void ClangPreprocessorAssistProposalItem::apply(TextEditor::TextDocumentManipula
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_typedCharacter.isNull()) {
|
if (!m_typedCharacter.isNull())
|
||||||
extraCharacters += m_typedCharacter;
|
extraCharacters += m_typedCharacter;
|
||||||
if (cursorOffset != 0)
|
|
||||||
--cursorOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Avoid inserting characters that are already there
|
// Avoid inserting characters that are already there
|
||||||
const int endsPosition = manipulator.positionAt(TextEditor::EndOfLinePosition);
|
const int endsPosition = manipulator.positionAt(TextEditor::EndOfLinePosition);
|
||||||
@@ -101,9 +97,7 @@ void ClangPreprocessorAssistProposalItem::apply(TextEditor::TextDocumentManipula
|
|||||||
// Insert the remainder of the name
|
// Insert the remainder of the name
|
||||||
const int length = manipulator.currentPosition() - basePosition + existLength + extraLength;
|
const int length = manipulator.currentPosition() - basePosition + existLength + extraLength;
|
||||||
|
|
||||||
const bool isReplaced = manipulator.replace(basePosition, length, textToBeInserted);
|
manipulator.replace(basePosition, length, textToBeInserted);
|
||||||
if (isReplaced && cursorOffset)
|
|
||||||
manipulator.setCursorPosition(manipulator.currentPosition() + cursorOffset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClangPreprocessorAssistProposalItem::setText(const QString &text)
|
void ClangPreprocessorAssistProposalItem::setText(const QString &text)
|
||||||
|
|||||||
Reference in New Issue
Block a user