Commit b497a346 authored by Nikolai Kosjar's avatar Nikolai Kosjar

CppEditor: Fix always-false-condition

The condition didn't make sense. tk.kind() can't be < T_FIRST_QT_KEYWORD
*and* tk.kind() > T_LAST_KEYWORD at the same time.

Change-Id: Id300ad84f37eeff5081b0389c00d574a9cb23f35
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 503bd401
...@@ -227,9 +227,8 @@ enum Kind { ...@@ -227,9 +227,8 @@ enum Kind {
T_WCHAR_T, T_WCHAR_T,
T_LAST_PRIMITIVE = T_WCHAR_T, T_LAST_PRIMITIVE = T_WCHAR_T,
T_FIRST_QT_KEYWORD,
// Qt keywords // Qt keywords
T_FIRST_QT_KEYWORD,
T_EMIT = T_FIRST_QT_KEYWORD, T_EMIT = T_FIRST_QT_KEYWORD,
T_SIGNAL, T_SIGNAL,
T_SLOT, T_SLOT,
...@@ -251,8 +250,8 @@ enum Kind { ...@@ -251,8 +250,8 @@ enum Kind {
T_Q_DECLARE_INTERFACE, T_Q_DECLARE_INTERFACE,
T_Q_OBJECT, T_Q_OBJECT,
T_Q_GADGET, T_Q_GADGET,
T_LAST_QT_KEYWORD = T_Q_GADGET,
T_LAST_KEYWORD = T_Q_GADGET, T_LAST_KEYWORD = T_LAST_QT_KEYWORD,
// aliases // aliases
T_OR = T_PIPE_PIPE, T_OR = T_PIPE_PIPE,
...@@ -330,6 +329,9 @@ public: ...@@ -330,6 +329,9 @@ public:
inline bool isPrimitiveType() const inline bool isPrimitiveType() const
{ return f.kind >= T_FIRST_PRIMITIVE && f.kind <= T_LAST_PRIMITIVE; } { return f.kind >= T_FIRST_PRIMITIVE && f.kind <= T_LAST_PRIMITIVE; }
inline bool isQtKeyword() const
{ return f.kind >= T_FIRST_QT_KEYWORD && f.kind <= T_LAST_QT_KEYWORD; }
inline bool isComment() const inline bool isComment() const
{ return f.kind == T_COMMENT || f.kind == T_DOXY_COMMENT || { return f.kind == T_COMMENT || f.kind == T_DOXY_COMMENT ||
f.kind == T_CPP_COMMENT || f.kind == T_CPP_DOXY_COMMENT; } f.kind == T_CPP_COMMENT || f.kind == T_CPP_DOXY_COMMENT; }
......
...@@ -581,7 +581,7 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor & ...@@ -581,7 +581,7 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &
} }
} }
if (tk.isNot(T_IDENTIFIER) && tk.kind() < T_FIRST_QT_KEYWORD && tk.kind() > T_LAST_KEYWORD) if (tk.isNot(T_IDENTIFIER) && !tk.isQtKeyword())
return link; return link;
tc.setPosition(endOfToken); tc.setPosition(endOfToken);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment