summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/itemviews/qitemdelegate.cpp2
-rw-r--r--tools/linguist/shared/java.cpp16
2 files changed, 12 insertions, 6 deletions
diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp
index bf9b5c5..3b7eb2d 100644
--- a/src/gui/itemviews/qitemdelegate.cpp
+++ b/src/gui/itemviews/qitemdelegate.cpp
@@ -218,7 +218,7 @@ QSizeF QItemDelegatePrivate::doTextLayout(int lineWidth) const
editor widget, which is a widget that is placed on top of the view
while editing takes place. Editors are created with a
QItemEditorFactory; a default static instance provided by
- QItemEditorFactory is installed on all item delagates. You can set
+ QItemEditorFactory is installed on all item delegates. You can set
a custom factory using setItemEditorFactory() or set a new default
factory with QItemEditorFactory::setDefaultFactory(). It is the
data stored in the item model with the Qt::EditRole that is edited.
diff --git a/tools/linguist/shared/java.cpp b/tools/linguist/shared/java.cpp
index 912a8d7..4c244d2 100644
--- a/tools/linguist/shared/java.cpp
+++ b/tools/linguist/shared/java.cpp
@@ -58,7 +58,7 @@ enum { Tok_Eof, Tok_class, Tok_return, Tok_tr,
Tok_Comment, Tok_String, Tok_Colon, Tok_Dot,
Tok_LeftBrace, Tok_RightBrace, Tok_LeftParen,
Tok_RightParen, Tok_Comma, Tok_Semicolon,
- Tok_Integer, Tok_Plus, Tok_PlusPlus, Tok_PlusEq };
+ Tok_Integer, Tok_Plus, Tok_PlusPlus, Tok_PlusEq, Tok_null };
class Scope
{
@@ -142,7 +142,11 @@ static int getToken()
case 'c':
if ( yyIdent == QLatin1String("class") )
return Tok_class;
- break;
+ break;
+ case 'n':
+ if ( yyIdent == QLatin1String("null") )
+ return Tok_null;
+ break;
}
}
switch ( yyIdent.at(0).toLatin1() ) {
@@ -382,9 +386,11 @@ static bool matchInteger( qlonglong *number)
static bool matchStringOrNull(QString &s)
{
bool matches = matchString(s);
- qlonglong num = 0;
- if (!matches) matches = matchInteger(&num);
- return matches && num == 0;
+ if (!matches) {
+ matches = (yyTok == Tok_null);
+ if (matches) yyTok = getToken();
+ }
+ return matches;
}
/*