Skip to content

Commit

Permalink
Break oneliners
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 31, 2016
1 parent 88871c2 commit f438542
Showing 1 changed file with 33 additions and 14 deletions.
47 changes: 33 additions & 14 deletions src/core/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,21 +108,36 @@ static QVariant tvl2variant( TVL v )

inline bool isIntSafe( const QVariant& v )
{
if ( v.type() == QVariant::Int ) return true;
if ( v.type() == QVariant::UInt ) return true;
if ( v.type() == QVariant::LongLong ) return true;
if ( v.type() == QVariant::ULongLong ) return true;
if ( v.type() == QVariant::Double ) return false;
if ( v.type() == QVariant::String ) { bool ok; v.toString().toInt( &ok ); return ok; }
if ( v.type() == QVariant::Int )
return true;
if ( v.type() == QVariant::UInt )
return true;
if ( v.type() == QVariant::LongLong )
return true;
if ( v.type() == QVariant::ULongLong )
return true;
if ( v.type() == QVariant::Double )
return false;
if ( v.type() == QVariant::String )
{
bool ok;
v.toString().toInt( &ok );
return ok;
}
return false;
}
inline bool isDoubleSafe( const QVariant& v )
{
if ( v.type() == QVariant::Double ) return true;
if ( v.type() == QVariant::Int ) return true;
if ( v.type() == QVariant::UInt ) return true;
if ( v.type() == QVariant::LongLong ) return true;
if ( v.type() == QVariant::ULongLong ) return true;
if ( v.type() == QVariant::Double )
return true;
if ( v.type() == QVariant::Int )
return true;
if ( v.type() == QVariant::UInt )
return true;
if ( v.type() == QVariant::LongLong )
return true;
if ( v.type() == QVariant::ULongLong )
return true;
if ( v.type() == QVariant::String )
{
bool ok;
Expand All @@ -135,8 +150,9 @@ inline bool isDoubleSafe( const QVariant& v )

inline bool isDateTimeSafe( const QVariant& v )
{
return v.type() == QVariant::DateTime || v.type() == QVariant::Date ||
v.type() == QVariant::Time;
return v.type() == QVariant::DateTime
|| v.type() == QVariant::Date
|| v.type() == QVariant::Time;
}

inline bool isIntervalSafe( const QVariant& v )
Expand All @@ -153,7 +169,10 @@ inline bool isIntervalSafe( const QVariant& v )
return false;
}

inline bool isNull( const QVariant& v ) { return v.isNull(); }
inline bool isNull( const QVariant& v )
{
return v.isNull();
}

///////////////////////////////////////////////
// evaluation error macros
Expand Down

0 comments on commit f438542

Please sign in to comment.