forked from qt-creator/qt-creator
CppEditor: Fix "! condition" coding style
Change-Id: I216b74933f5e94c49be7f05f0b09ac01b3319d8c Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
This commit is contained in:
@@ -243,7 +243,7 @@ struct CanonicalSymbol
|
||||
const QTextCursor &cursor,
|
||||
QString *code)
|
||||
{
|
||||
if (! info.doc)
|
||||
if (!info.doc)
|
||||
return 0;
|
||||
|
||||
QTextCursor tc = cursor;
|
||||
@@ -255,8 +255,8 @@ struct CanonicalSymbol
|
||||
|
||||
int pos = tc.position();
|
||||
|
||||
if (! isIdentifierChar(document->characterAt(pos)))
|
||||
if (! (pos > 0 && isIdentifierChar(document->characterAt(pos - 1))))
|
||||
if (!isIdentifierChar(document->characterAt(pos)))
|
||||
if (!(pos > 0 && isIdentifierChar(document->characterAt(pos - 1))))
|
||||
return 0;
|
||||
|
||||
while (isIdentifierChar(document->characterAt(pos)))
|
||||
@@ -293,7 +293,7 @@ struct CanonicalSymbol
|
||||
const LookupItem &r = results.at(i);
|
||||
Symbol *decl = r.declaration();
|
||||
|
||||
if (! (decl && decl->enclosingScope()))
|
||||
if (!(decl && decl->enclosingScope()))
|
||||
break;
|
||||
|
||||
if (Class *classScope = r.declaration()->enclosingScope()->asClass()) {
|
||||
@@ -771,7 +771,7 @@ void CPPEditorWidget::onDocumentUpdated()
|
||||
|
||||
const Macro *CPPEditorWidget::findCanonicalMacro(const QTextCursor &cursor, Document::Ptr doc) const
|
||||
{
|
||||
if (! doc)
|
||||
if (!doc)
|
||||
return 0;
|
||||
|
||||
int line, col;
|
||||
@@ -883,7 +883,7 @@ void CPPEditorWidget::markSymbols(const QTextCursor &tc, const SemanticInfo &inf
|
||||
{
|
||||
abortRename();
|
||||
|
||||
if (! info.doc)
|
||||
if (!info.doc)
|
||||
return;
|
||||
|
||||
if (const Macro *macro = findCanonicalMacro(textCursor(), info.doc)) {
|
||||
@@ -934,7 +934,7 @@ void CPPEditorWidget::markSymbols(const QTextCursor &tc, const SemanticInfo &inf
|
||||
} else {
|
||||
const QList<QTextEdit::ExtraSelection> selections = extraSelections(CodeSemanticsSelection);
|
||||
|
||||
if (! selections.isEmpty())
|
||||
if (!selections.isEmpty())
|
||||
setExtraSelections(CodeSemanticsSelection, QList<QTextEdit::ExtraSelection>());
|
||||
}
|
||||
}
|
||||
@@ -1011,7 +1011,7 @@ void CPPEditorWidget::jumpToOutlineElement(int index)
|
||||
modelIndex = m_proxyModel->index(index, 0); // toplevel index
|
||||
QModelIndex sourceIndex = m_proxyModel->mapToSource(modelIndex);
|
||||
Symbol *symbol = m_outlineModel->symbolFromIndex(sourceIndex);
|
||||
if (! symbol)
|
||||
if (!symbol)
|
||||
return;
|
||||
|
||||
openCppEditorAt(linkToSymbol(symbol));
|
||||
@@ -1248,10 +1248,10 @@ static inline LookupItem skipForwardDeclarations(const QList<LookupItem> &resolv
|
||||
const FullySpecifiedType ty = result.type().simplified();
|
||||
|
||||
if (ty->isForwardClassDeclarationType()) {
|
||||
while (! candidates.isEmpty()) {
|
||||
while (!candidates.isEmpty()) {
|
||||
LookupItem r = candidates.takeFirst();
|
||||
|
||||
if (! r.type()->isForwardClassDeclarationType()) {
|
||||
if (!r.type()->isForwardClassDeclarationType()) {
|
||||
result = r;
|
||||
break;
|
||||
}
|
||||
@@ -1259,10 +1259,10 @@ static inline LookupItem skipForwardDeclarations(const QList<LookupItem> &resolv
|
||||
}
|
||||
|
||||
if (ty->isObjCForwardClassDeclarationType()) {
|
||||
while (! candidates.isEmpty()) {
|
||||
while (!candidates.isEmpty()) {
|
||||
LookupItem r = candidates.takeFirst();
|
||||
|
||||
if (! r.type()->isObjCForwardClassDeclarationType()) {
|
||||
if (!r.type()->isObjCForwardClassDeclarationType()) {
|
||||
result = r;
|
||||
break;
|
||||
}
|
||||
@@ -1270,10 +1270,10 @@ static inline LookupItem skipForwardDeclarations(const QList<LookupItem> &resolv
|
||||
}
|
||||
|
||||
if (ty->isObjCForwardProtocolDeclarationType()) {
|
||||
while (! candidates.isEmpty()) {
|
||||
while (!candidates.isEmpty()) {
|
||||
LookupItem r = candidates.takeFirst();
|
||||
|
||||
if (! r.type()->isObjCForwardProtocolDeclarationType()) {
|
||||
if (!r.type()->isObjCForwardProtocolDeclarationType()) {
|
||||
result = r;
|
||||
break;
|
||||
}
|
||||
@@ -1359,7 +1359,7 @@ CPPEditorWidget::Link CPPEditorWidget::attemptFuncDeclDef(const QTextCursor &cur
|
||||
|
||||
CPPEditorWidget::Link CPPEditorWidget::findMacroLink(const QByteArray &name) const
|
||||
{
|
||||
if (! name.isEmpty()) {
|
||||
if (!name.isEmpty()) {
|
||||
if (Document::Ptr doc = m_lastSemanticInfo.doc) {
|
||||
const Snapshot snapshot = m_modelManager->snapshot();
|
||||
QSet<QString> processed;
|
||||
@@ -1375,7 +1375,7 @@ CPPEditorWidget::Link CPPEditorWidget::findMacroLink(const QByteArray &name,
|
||||
const Snapshot &snapshot,
|
||||
QSet<QString> *processed) const
|
||||
{
|
||||
if (doc && ! name.startsWith('<') && ! processed->contains(doc->fileName())) {
|
||||
if (doc && !name.startsWith('<') && !processed->contains(doc->fileName())) {
|
||||
processed->insert(doc->fileName());
|
||||
|
||||
foreach (const Macro ¯o, doc->definedMacros()) {
|
||||
@@ -1476,7 +1476,7 @@ CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor, boo
|
||||
if (tokens.at(j).is(T_LPAREN)) {
|
||||
++depth;
|
||||
} else if (tokens.at(j).is(T_RPAREN)) {
|
||||
if (! --depth)
|
||||
if (!--depth)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1508,7 +1508,7 @@ CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor, boo
|
||||
const QTextBlock block = tc.block();
|
||||
int pos = cursor.positionInBlock();
|
||||
QChar ch = document()->characterAt(cursor.position());
|
||||
if (pos > 0 && ! (ch.isLetterOrNumber() || ch == QLatin1Char('_')))
|
||||
if (pos > 0 && !(ch.isLetterOrNumber() || ch == QLatin1Char('_')))
|
||||
--pos; // positionInBlock points to a delimiter character.
|
||||
const Token tk = SimpleLexer::tokenAt(block.text(), pos,
|
||||
BackwardsScanner::previousBlockState(block), true);
|
||||
@@ -1567,7 +1567,7 @@ CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor, boo
|
||||
const QChar ch = document()->characterAt(pos);
|
||||
if (ch.isSpace())
|
||||
continue;
|
||||
if (ch == QLatin1Char('(') && ! expression.isEmpty()) {
|
||||
if (ch == QLatin1Char('(') && !expression.isEmpty()) {
|
||||
tc.setPosition(pos);
|
||||
if (TextEditor::TextBlockUserData::findNextClosingParenthesis(&tc, true))
|
||||
expression.append(tc.selectedText());
|
||||
@@ -1648,7 +1648,7 @@ Symbol *CPPEditorWidget::findDefinition(Symbol *symbol, const Snapshot &snapshot
|
||||
if (symbol->isFunction())
|
||||
return 0; // symbol is a function definition.
|
||||
|
||||
else if (! symbol->type()->isFunctionType())
|
||||
else if (!symbol->type()->isFunctionType())
|
||||
return 0; // not a function declaration
|
||||
|
||||
return symbolFinder()->findMatchingDefinition(symbol, snapshot);
|
||||
@@ -1729,7 +1729,7 @@ void CPPEditorWidget::contextMenuEvent(QContextMenuEvent *e)
|
||||
|
||||
QSignalMapper mapper;
|
||||
connect(&mapper, SIGNAL(mapped(int)), this, SLOT(performQuickFix(int)));
|
||||
if (! isOutdated()) {
|
||||
if (!isOutdated()) {
|
||||
TextEditor::IAssistInterface *interface =
|
||||
createAssistInterface(TextEditor::QuickFix, TextEditor::ExplicitlyInvoked);
|
||||
if (interface) {
|
||||
@@ -2057,7 +2057,7 @@ void CPPEditorWidget::updateSemanticInfo(const SemanticInfo &semanticInfo)
|
||||
|
||||
setExtraSelections(UnusedSymbolSelection, unusedSelections);
|
||||
|
||||
if (! m_renameSelections.isEmpty())
|
||||
if (!m_renameSelections.isEmpty())
|
||||
setExtraSelections(CodeSemanticsSelection, m_renameSelections); // ###
|
||||
else
|
||||
markSymbols(textCursor(), semanticInfo);
|
||||
|
||||
Reference in New Issue
Block a user